Permalink
Browse files

Make executable

  • Loading branch information...
1 parent 82309d7 commit 4e0ccb5bed2febb0b64d039cce26650ebc38beba @BjarniRunar BjarniRunar committed May 8, 2012
Showing with 30 additions and 0 deletions.
  1. 0 setup.py
  2. +30 −0 test.py
View
0 setup.py 100644 → 100755
No changes.
View
30 test.py
@@ -0,0 +1,30 @@
+#!/usr/bin/python
+import ftplib
+import telnetlib
+import urllib2
+
+# Import SocksiPy
+import sockschain as socks
+def DEBUG(msg): print msg
+socks.DEBUG = DEBUG
+
+# Set the proxy information
+#socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, 'localhost', 9050)
+socks.setdefaultproxy(socks.PROXY_TYPE_HTTP, 'klaki.net', 18080)
+
+# Route an HTTP request through the SOCKS proxy
+socks.wrapmodule(urllib2)
+print urllib2.urlopen('http://automation.whatismyip.com/n09230945.asp').read()
+
+# Route an FTP session through the SOCKS proxy
+#socks.wrapmodule(ftplib)
+#ftp = ftplib.FTP('cdimage.ubuntu.com')
+#ftp.login('anonymous', 'support@aol.com')
+#print ftp.dir('cdimage')
+#ftp.close()
+
+# Route a telnet connection through the SOCKS proxy
+socks.wrapmodule(telnetlib)
+tn = telnetlib.Telnet('achaea.com')
+print tn.read_very_eager()
+tn.close()

0 comments on commit 4e0ccb5

Please sign in to comment.