[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [obfsproxy/master] Added 'src/test/test_socks_unsupported.py' which tests the SOCKS5_FAILED_UNSUPPORTED



commit 0b2750f4323e8a1f04dc1b64be1b5b43f0a7f127
Author: George Kadianakis <desnacked@xxxxxxxxx>
Date:   Tue May 24 16:52:39 2011 +0200

    Added 'src/test/test_socks_unsupported.py' which tests the SOCKS5_FAILED_UNSUPPORTED
    reply on the wire (since there is already a unit test for this.).
---
 src/test/test_socks_unsupported.py |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/test/test_socks_unsupported.py b/src/test/test_socks_unsupported.py
new file mode 100644
index 0000000..c0d625c
--- /dev/null
+++ b/src/test/test_socks_unsupported.py
@@ -0,0 +1,16 @@
+import socket,struct
+
+negot = struct.pack('BBB', 5, 1, 0)
+request = struct.pack('BBBBBBB', 5, 2, 0, 1, 1, 1, 1)
+
+PORT = 4500
+
+s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+s.connect(("127.0.0.1",PORT))
+s.send(negot)
+s.recv(1024)
+s.send(request)
+data = s.recv(1024)
+if (struct.unpack('BBBBih', data)[1] == 7):
+    print "Works."
+



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits