diff --git a/Networking/WebSockets/websocket_simple_client.py b/Networking/WebSockets/websocket_simple_client.py new file mode 100644 index 0000000..d9520f2 --- /dev/null +++ b/Networking/WebSockets/websocket_simple_client.py @@ -0,0 +1,18 @@ +# +# Very simple WebSocket client +# 14.10.2017 +# chris2286266 +# + +from websocket import create_connection + +ws = 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() \ No newline at end of file