summaryrefslogtreecommitdiff
path: root/proxy.py
diff options
context:
space:
mode:
Diffstat (limited to 'proxy.py')
-rw-r--r--proxy.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/proxy.py b/proxy.py
new file mode 100644
index 0000000..5c37bb7
--- /dev/null
+++ b/proxy.py
@@ -0,0 +1,41 @@
+from omegle import OmegleChat
+import sys
+
+
+class OmegleProxyChat(OmegleChat):
+ def __init__(self,name):
+ OmegleChat.__init__(self)
+ self.name = name
+
+ def set_partner(self,partner):
+ self.partner = partner
+
+ def on_message(self,message):
+ print "%s: %s" %(self.name, message)
+ self.partner.send(message)
+ def on_connect(self):
+ print "%s Connected" % self.name
+ def on_typing(self):
+ print "%s is typing" % self.name
+ self.partner.typing()
+ def on_disconnect(self):
+ print "%s disconnect" % self.name
+ self.partner.disconnect()
+
+A=OmegleProxyChat("A")
+B=OmegleProxyChat("B")
+
+A.set_partner(B)
+B.set_partner(A)
+
+A.start()
+B.start()
+
+print "press enter to abort"
+sys.stdin.readline()
+
+A.disconnect()
+B.disconnect()
+
+
+