in reply to Networking in perl

Before reinventing the wheel, you might want to evaluate existing web proxies (e.g. squid) as to whether they might help in your case...

Of course, you can write your own proxy in Perl (preferably based on HTTP::Proxy), but I wouldn't do it at the IP level. Just provide a TCP socket that the browser can connect to the normal way.