blob: d4fa3b77abf2ea0e05a22db31ba4076ae162e816 (
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://echo.websocket.org/")
print("Sending 'Hello, World'...")
ws.send("Hello, World")
print("Sent")
print("Receiving...")
result = ws.recv()
print("Received '%s'" % result)
ws.close()
|