5 Replies Latest reply on Sep 29, 2012 4:42 PM by TᴀW

    Socket object problem

    TᴀW Adobe Community Professional & MVP

      Hi,

       

      I'm trying to play around with the socket object a little, and having no

      luck.

       

      On my website, there's a file called www.freelancebookdesign.com/robots.txt

       

      Open it in your browser and you'll see that there's some text in there.

       

      I would like to get at that file through scripting.

       

      So I try:

       

      conn = new Socket;

      if (conn.open ("www.freelancebookdesign.com:80")) {

           conn.write("GET /robots.txt HTTP/1.0\n\n");

           reply = conn.read(999999);

           conn.close();

           alert(reply);

      }

      else ("Unable to open connection!");

       

      All I get is a "Page not found or temporarily unavailable" error -- even

      though via a browser it works fine.

       

      Anyone know why this isn't working?

       

      Your help is much appreciated!

       

      Thanks,

      Ariel