in reply to Working with ports in Perl

Depending on the nature of your data, there are two ways, easy and hard. I interpret your question that way, that you want to have a proxy that sits in the middle between your program and the outside network.

The easy way is if you only want to intercept HTTP data. Then you can use HTTP::Proxy.

The hard way is if you want to intercept other data. Then you have to use Net::PCap together with Net::PCapUtils, which allows you to sniff and alter any TCP transmission. There are some other more convenient modules, like Net::Divert and Net::ProxyMod (by Stephanie Wehner), but these module are for BSD(-like) systems only, as they use features only found there.

Replies are listed 'Best First'.
Re: Re: Working with ports in Perl
by Steve_p (Priest) on Apr 18, 2004 at 14:31 UTC

    Another libpcap related module you can use in Net::RawIP. It has a more OO based interface, and the documentation seems to be a little more easy to follow and quicker to get started with.