Listening to http traffic on a particular interface

I am looking for a way to listen on http traffic only on a particular network interface (or alternatively be able to filter packets based on the interface they arrive from).

Any ideas?

Thanks in advance.

You probably want a pcap package, of which there are a few. Here’s a blog post describing how to use one of them:

1 Like

Thanks I’ll have a look.

You mean you want to serve requests on a particular interface? You need to specify your own listener, something like this:

In that example the listener is limited to a port and IPv4 clients. Look at the documentation for net.Listener:


Marcelos answer is probably the right one here, I suspect I misunderstood you. :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.