Proxy in perl

S

secSwami

Thanks Tim and Martein for your reponses on this. Here is what I am
doing to setup a simple proxy on my box localy using HTTP::proxy module.


#!/usr/bin/perl
use HTTP::proxy;


my $proxy=HTTP::proxy->new (port => 3128);

$proxy->start;


Just these 4 lines starts up the proxy server on my local machine
listening on port 3128 and then I point my browser's proxy setting to
"localhost" and port "3128". This all works great. No issues there.

However, I would like to see the URL that the user just typed in the
broswer and then take the URL and see if another upstream server app
thinks its blocked or not (a central server) and if the central server
returns a block then spit that out to the users browser. How can I
intercept the user request? and see what that request was in the code above.

Thanks a bunch guys. Really appreciate it.
 
B

Ben Morrow

Quoth secSwami said:
Thanks Tim and Martein for your reponses on this. Here is what I am
doing to setup a simple proxy on my box localy using HTTP::proxy module.

#!/usr/bin/perl
use HTTP::proxy;


my $proxy=HTTP::proxy->new (port => 3128);

$proxy->start;


Just these 4 lines starts up the proxy server on my local machine
listening on port 3128 and then I point my browser's proxy setting to
"localhost" and port "3128". This all works great. No issues there.

However, I would like to see the URL that the user just typed in the
broswer and then take the URL and see if another upstream server app
thinks its blocked or not (a central server) and if the central server
returns a block then spit that out to the users browser. How can I
intercept the user request? and see what that request was in the code above.

You need to use the ->push_filter method on the proxy object before you
call ->start. See the documentation for HTTP::proxy.

Ben
 
S

secSwami

Ben said:
You need to use the ->push_filter method on the proxy object before you
call ->start. See the documentation for HTTP::proxy.

Ben

Thanks Ben. I will give it a shot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top