TorAS is an ActionScript implementation of the Tor control and communication (SOCKS5) protocols. The library comes bundled with the binary Tor client which can be launched by an AIR application as an invisible background process — no extra installation or setup required. Once connected, TorAS gives developers unprecedented control and insight over their Tor network connection, as well as providing simplified access to the secure, anonymous communication channels for which Tor is famous.
The library has a number of default settings and pre-configurations intended to start the services automatically. While this will probably be sufficient for most developers, at least initially. It’s possible to gain additional low-level control by issuing direct commands to the Tor control and communication sockets.
Sample
import import flash.net.URLRequest; import import flash.net.URLVariables; import org.torproject.SOCKS5Tunnel; import org.torproject.events.SOCKS5TunnelEvent; var request:URLRequest=new URLRequest("http://www.myserver.com/"); var variables=new URLVariables(); variables.userName="Patrick"; variables.password="pass123"; request.data=variables; var tunnel:SOCK5Tunnel = new SOCKS5Tunnel(); tunnel.addEventListener(SOCKS5TunnelEvent.ONHTTPRESPONSE, onSOCKSTunnelResponse); tunnel.loadHTTP(request); function onSOCKSTunnelResponse(eventObj:SOCKS5TunnelEvent):void { trace ("Got response: "); trace (eventObj.httpResponse.body); }