I’ve been able to set up sending and listening to http requests locally using 127.0.0.1:8000. I want to try doing it using the internet now.

I have a VPN with port forwarding enabled, but sending requests to that IP address and port does not yield a response like it did when doing it locally.

Can anyone clarify which address I should be listening on in order to receive http requests from the internet? I tried 0.0.0.0 and a few inet addresses from ip add, but none of them work.

  • Scrubbles
    link
    fedilink
    English
    21 day ago

    Right, so are you sending anything, or how have you redirected traffic to it?

    • Possibly linux
      link
      fedilink
      English
      11 day ago

      In unicast traffic is sent to the network interface when it matches the IP. In a layer 2 lan this is done by using ARP to query the Mac associated with the IP. When traffic gets routed in layer 3 it is done by subnet.

      When a new packet is received the OS then will put the data into a buffer accessible by the application. When an application “listens” it is simply telling the OS that it wants to be the one to process incoming data on a particular IP and port.

      With multicast, a client requests a particular IP be sent to it via IGMP packets.

      • Scrubbles
        link
        fedilink
        English
        223 hours ago

        There is no multicast over the open Internet. At least not at a layer you would ever see. The only HTTP requests you will ever see are the ones that are specifically requested to your server. What you’re doing would work internally inside a private network if you’re trying to do that, but it sounds like you confirmed that already.

          • Scrubbles
            link
            fedilink
            English
            119 hours ago

            Sure, you can, but nobody does it and most consumer networks actively block it. Not to mention that multicast is UDP, http is over TCP, so it’s irrelevant to your question anyway. There is no “listening” to http traffic unless you are looking to listen for traffic sent explicitly to you, which is why everyone is asking you - what are you trying to do?

            Are you trying to set up an http server that listens through a VPN, to serve a webpage or API or something?

            Do you just want to listen to random UDP multicast traffic? That has nothing to do with http, and idk why you would want to since no one does, but I suppose you could.

            Or are you misunderstanding networking and thinking you can somehow listen to someone else’s Internet traffic? Which you can’t, unless you meet a specific set of criteria - which I’m not going to go into at this point.

            You’re unwilling or unable to explain your actual problem, which is why I’m getting frustrated with you. I’m not asking about protocols you’re listening on, or questioning your Wikipedia skills, all I want to know is what are you trying to do?

            • Possibly linux
              link
              fedilink
              English
              2
              edit-2
              19 hours ago

              I’m not the author of this post.

              I just was trying to make sense of what they were asking about.

              • Scrubbles
                link
                fedilink
                English
                119 hours ago

                Oh god I’m so sorry, I thought they were jumping in, foot in mouth for sure. I’ll leave it there so maybe they see it, but official apologies to you