this post was submitted on 17 Jan 2025
9 points (73.7% liked)

networking

2856 readers
21 users here now

Community for discussing enterprise networks and the ensuing chaos that comes after inheriting or building one.

founded 2 years ago
MODERATORS
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] scrubbles@poptalk.scrubbles.tech 2 points 1 day ago (1 children)

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

[–] possiblylinux127@lemmy.zip 1 points 23 hours ago (1 children)

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@poptalk.scrubbles.tech 2 points 17 hours ago (1 children)

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.

[–] possiblylinux127@lemmy.zip 1 points 13 hours ago (1 children)

There is multicast on the public internet. Obviously you can't do http since it is UDP but it is routable.

https://en.wikipedia.org/wiki/Multicast

[–] scrubbles@poptalk.scrubbles.tech 1 points 13 hours ago (1 children)

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?

[–] possiblylinux127@lemmy.zip 2 points 13 hours ago* (last edited 13 hours ago) (1 children)

I'm not the author of this post.

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

[–] scrubbles@poptalk.scrubbles.tech 1 points 13 hours ago (1 children)

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

[–] possiblylinux127@lemmy.zip 1 points 12 hours ago

All good

I just found it really funny