blob: f8f6bf35e9968c1b458a8a21583935bb6f5def9c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
import websocket
if __name__ == "__main__":
websocket.enableTrace(True)
ws = websocket.create_connection("ws://localhost:5000/chat")
print "Sending 'Hello, World'..."
ws.send("Hello, World")
print "Sent"
print "Receiving..."
result = ws.recv()
print "Received '%s'" % result
ws.close()
|