![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Proxy server on Digital UNIX V4.0E ? | alvoryx | UNIX for Dummies Questions & Answers | 0 | 10-25-2006 03:29 PM |
| how to get IP for proxy server | ppass | Linux | 3 | 09-26-2005 09:46 AM |
| (perl) Microsoft SQL Server client for solaris. cant find it... | Optimus_P | Shell Programming and Scripting | 3 | 10-14-2002 12:13 PM |
| unix server behind MS proxy server | RSlegers | UNIX for Dummies Questions & Answers | 2 | 09-16-2002 11:08 PM |
| routing through a proxy server | garry | IP Networking | 2 | 01-30-2002 05:18 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Proxy server/client in Perl
I have been toying with a Proxy client/server app that will listen on the CLIENT system on lets say port 7070. User's browser proxy setting is configured for "localhost" port "7070". When this proxy app gets a request for a URL it should FETCH the URL and display it on the browser. I already made the listener portion of the script (it was easy) but how can I then call and get the URL that the user will request on their browser and display it to the browser acting like a proxy. Here is the code so far. I am totally stuck ..any help is highly appreciated ![]() Code:
#!/usr/bin/perl
use IO::Socket;
my $sock= new IO::Socket::INET (
LocalHost=> 'localhost',
LocalPort=> '7070',
Proto=> 'tcp',
Listen=> 1,
Reuse=> 1,
Type=> SOCK_STREAM,
);
die "Could not create socket: $!\n" unless $sock;
my $new_sock = $sock->accept();
while (<$new_sock>) {
print $_;
}
close ($sock);
|
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|