perl proxy for browser

2004-02-03 Thread Jeremy A
hi all,

I found this perl proxy code on the net.
I am trying to make this proxy work that my internet explorer browser can 
use. my future plan is to monitor information with this proxy.
To set this up, in internet explorer, i went to menu Tools-Internet 
Options-Connections-Lan Settings. checked use proxy server for your 
lan, entered in the address 192.168.1.101, entered in the port 80
I then executed the proxy script, then re-opened internet explorer and went 
to a site eg www.msn.com.

the proxy script would print (in the console) Client: GET 
http://www.msn.com/ HTTP/1.0, then it hangs, and so does internet explorer.

What is wrong with this script? how can i get it to work?

Thanks in advance for your help,

Regards,

Jeremy A.

---perl proxy code i found

use strict;

use IO::Socket;
use IO::Select;
my $proxyPort = 80;

my $destHost  = 192.168.1.101;
my $destPort  = 80;
my $proxy = IO::Socket::INET-new (
   LocalPort = $proxyPort,
   Type  = SOCK_STREAM,
   Reuse = 1,
   Listen= 10);
binmode $proxy;

while (my $client = $proxy-accept()) {
  binmode $client;
  my $dest = IO::Socket::INET-new (
PeerAddr= $destHost,
PeerPort= $destPort);
  binmode $dest;

  my $select = new IO::Select;
  $select - add ($dest);
  $select - add ($client);
  autoflush $dest;
  autoflush $client;
  while (my @ready = $select-can_read) {
foreach my $fd (@ready) {
  if ($fd == $client) {
my $clientLine = $client;
print Client: $clientLine;
print $dest $clientLine;
  }
  if ($fd == $dest) {
my $destLine = $dest;
print Dest: $destLine;
print $client $destLine;
  }
}
  }
}









___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: perl proxy for browser

2004-02-03 Thread $Bill Luebkert
Jeremy A wrote:
hi all,

I found this perl proxy code on the net.
I am trying to make this proxy work that my internet explorer browser 
can use. my future plan is to monitor information with this proxy.
To set this up, in internet explorer, i went to menu Tools-Internet 
Options-Connections-Lan Settings. checked use proxy server for your 
lan, entered in the address 192.168.1.101, entered in the port 80
I then executed the proxy script, then re-opened internet explorer and 
went to a site eg www.msn.com.

the proxy script would print (in the console) Client: GET 
http://www.msn.com/ HTTP/1.0, then it hangs, and so does internet 
explorer.

What is wrong with this script? how can i get it to work?
Kinda of a half-baked solution I should think.  This script might
help you write something more useable (or use as is to monitor) :
http://www.schmerg.com/WrapUp.asp?file=HttpSniffer.html

---perl proxy code i found

use strict;

use IO::Socket;
use IO::Select;
my $proxyPort = 80;

my $destHost  = 192.168.1.101;
my $destPort  = 80;
my $proxy = IO::Socket::INET-new (
   LocalPort = $proxyPort,
   Type  = SOCK_STREAM,
   Reuse = 1,
   Listen= 10);
binmode $proxy;

while (my $client = $proxy-accept()) {
  binmode $client;
  my $dest = IO::Socket::INET-new (
PeerAddr= $destHost,
PeerPort= $destPort);
  binmode $dest;

  my $select = new IO::Select;
  $select - add ($dest);
  $select - add ($client);
  autoflush $dest;
  autoflush $client;
  while (my @ready = $select-can_read) {
foreach my $fd (@ready) {
  if ($fd == $client) {
my $clientLine = $client;
print Client: $clientLine;
print $dest $clientLine;
  }
  if ($fd == $dest) {
my $destLine = $dest;
print Dest: $destLine;
print $client $destLine;
  }
}
  }
}
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs