The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-29-2008
Dabheeruz Dabheeruz is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 19
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
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On




All times are GMT -4. The time now is 10:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0