OS: Windows 2000, Perl: ActiveState 5.6.1

Hi,

I'm trying to use IO::Sockets to get a web page. I'm not using LWP::UserAgent, because of Microsoft Proxy/NTLM issues,

http://www.perlmonks.com/index.pl?node_id=271214

I am unable to get the page the connection times out. I'm also running the test code from the proxy to avoid any NTLM issues for the time being.

use IO::Socket; $socket=IO::Socket::INET->new( Proto => 'tcp', PeerAddr => 'www.nai.com', PeerPort => 'http(80)'); print "... $socket\n"; # http://www.nai.com/us/index.asp print $socket "GET /us/index.asp HTTP/1.0"; open (OUT, ">out.txt"); while (<$socket>) { print OUT; } close (OUT); close $socket;

The output I get is...<br><br> HTTP/1.0 408 Request Time-out Server: AkamaiGHost Mime-Version: 1.0 Date: Mon, 07 Jul 2003 14:54:57 GMT Content-Type: text/html Content-Length: 163 Expires: Mon, 07 Jul 2003 14:54:57 GMT <HTML><HEAD> <TITLE>Request Timeout</TITLE> </HEAD><BODY> <H1>Request Timeout</H1> The server timed out while waiting for the browser's request.<P> </BODY></HTML>


Thanks.

Mitch

In reply to Web Page - IO::Sockets by Mitch

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.