in reply to Re^2: Changing WWW::Mechanize Request to obey ModSecurity rules
in thread Changing WWW::Mechanize Request to obey ModSecurity rules

Create a little program that creates a server socket, accepts a connection, and dumps the incoming data. Connect to that instead of a real HTTP server.
  • Comment on Re^3: Changing WWW::Mechanize Request to obey ModSecurity rules

Replies are listed 'Best First'.
Re^4: Changing WWW::Mechanize Request to obey ModSecurity rules
by Anonymous Monk on Feb 28, 2009 at 08:14 UTC
    Here you go, shows everything is as it should be :)
    #!/usr/bin/perl -- use strict; use warnings; use IO::Socket; my $sock = IO::Socket::INET->new ( Localhost => 'localhost', LocalPort => '18080', Proto => 'tcp', Listen => 1, ); die "cant do that: $!\n" unless $sock; print "Please contact me at: http://localhost:18080\n"; my $CRLF = "\015\012"; while(my $s = $sock->accept()){ while(<$s>){ print $s "Echo: $_"; last if /^\s+$/; } close $s; } close $sock; __END__ $ lwp-request http://localhost:18080 Echo: GET / HTTP/1.1 Echo: TE: deflate,gzip;q=0.3 Echo: Connection: TE, close Echo: Host: localhost:18080 Echo: User-Agent: lwp-request/2.06 Echo:
      $ nc -vv -l -p 18080

      That that is is that that is not is not