2 Replies Latest reply on Feb 18, 2009 4:06 PM by

    Javascript Socket Obj and Port 21

      I'm just trying to open a socket connection to an ftp server on port 21. I've read that people have had success over flex/flash, but I haven't been able to connect to port 21 with Javascript and there are no events or error messages associated with trying.

      I'd just like to know if its currently possible.
        • 1. Re: Javascript Socket Obj and Port 21
          Jeff Swartz Level 3
          Yes, you can use the Socket class to connect to an FTP server in JavaScript:

          var socket = new air.Socket("ftp.cs.berkeley.edu", 21);
          socket.addEventListener(air.Event.CONNECT, connected);
          socket.addEventListener(air.ProgressEvent.SOCKET_DATA, dataHandler);
          socket.addEventListener(air.IOErrorEvent.IO_ERROR, errorHandler);
          socket.addEventListener(air.SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
          1 person found this helpful
          • 2. Re: Javascript Socket Obj and Port 21
            thanks for the reply,

            hrmm.. im running that exact code with traces for each event.. and it goes directly to IO_ERROR.. any suggestions?