13 lines
324 B
Python
13 lines
324 B
Python
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()
|