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 02:29 PM
how to get IP for proxy server ppass Linux 3 09-26-2005 08:46 AM
(perl) Microsoft SQL Server client for solaris. cant find it... Optimus_P Shell Programming and Scripting 3 10-14-2002 11:13 AM
unix server behind MS proxy server RSlegers UNIX for Dummies Questions & Answers 2 09-16-2002 10:08 PM
routing through a proxy server garry IP Networking 2 01-30-2002 04:18 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-29-2008
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);
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-09-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,770
Apache has a built-in proxying module. Is there a particular reason that won't work for you?
Reply With Quote
Google The UNIX and Linux Forums
Reply

Bookmarks

Tags
None

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:




All times are GMT -4. The time now is 05:01 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66