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