Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Proxy in perl

Reply
Thread Tools

Proxy in perl

 
 
secSwami
Guest
Posts: n/a
 
      10-02-2008
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:roxy module.


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


my $proxy=HTTP:roxy->new (port => 312;

$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.



 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      10-02-2008

Quoth secSwami <(E-Mail Removed)>:
> 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:roxy module.
>
> #!/usr/bin/perl
> use HTTP:roxy;
>
>
> my $proxy=HTTP:roxy->new (port => 312;
>
> $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:roxy.

Ben

--
You poor take courage, you rich take care:
The Earth was made a common treasury for everyone to share
All things in common, all people one.
'We come in peace'---the order came to cut them down. [(E-Mail Removed)]
 
Reply With Quote
 
 
 
 
secSwami
Guest
Posts: n/a
 
      10-03-2008
Ben Morrow wrote:
> Quoth secSwami <(E-Mail Removed)>:
>> 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:roxy module.
>>
>> #!/usr/bin/perl
>> use HTTP:roxy;
>>
>>
>> my $proxy=HTTP:roxy->new (port => 312;
>>
>> $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:roxy.
>
> Ben
>


Thanks Ben. I will give it a shot.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Proxy pattern and java.lang.reflect.Proxy/InvocationHandler Karsten Wutzke Java 1 08-20-2007 11:05 AM
Facebook Proxy | MySpace Proxy 35085675@qq.com Java 0 08-14-2007 06:35 AM
Inbound Proxy and Outbound Proxy chellappa VOIP 0 04-07-2006 10:58 AM
Press Release: Scalable SIP Proxy and RTP Media Proxy for NAT traversal sales@lanscapecorp.com VOIP 1 01-23-2006 06:32 PM
Help to set up tomcat 4.1.27 behind socks proxy to access database outside the proxy vidy5300 Java 0 06-07-2004 02:23 PM



Advertisments