diff options
author | engn33r <engn33r@users.noreply.github.com> | 2022-10-25 00:00:00 +0000 |
---|---|---|
committer | engn33r <engn33r@users.noreply.github.com> | 2022-10-25 00:00:00 +0000 |
commit | 73fddb733fc7aaa974830110b01a223f1f73d353 (patch) | |
tree | 88376fc770d931faa248f9a840a3ecb86ea76de7 | |
parent | 6ff442c6b11b56d98583056c4832d48f284246dc (diff) | |
download | websocket-client-73fddb733fc7aaa974830110b01a223f1f73d353.tar.gz |
Remove broken websockets.org links from documentation
-rw-r--r-- | docs/source/getting_started.rst | 3 | ||||
-rw-r--r-- | docs/source/threading.rst | 2 | ||||
-rw-r--r-- | websocket/_core.py | 11 | ||||
-rw-r--r-- | websocket/tests/test_websocket.py | 2 |
4 files changed, 10 insertions, 8 deletions
diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 5f3e3f6..c69a1e7 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -12,8 +12,7 @@ For an easy example, run the following: The above command will provide you with an interactive terminal to communicate with the echo.websocket.events server. This server will echo back any message you -send it. You can test this WebSocket connection in your browser, without this -library, by visiting the URL https://websocket.org/echo.html. +send it. The wsdump.py script has many additional options too, so it's a great way to try using this library without writing any custom code. The output of diff --git a/docs/source/threading.rst b/docs/source/threading.rst index 51a74af..7870e71 100644 --- a/docs/source/threading.rst +++ b/docs/source/threading.rst @@ -60,7 +60,7 @@ trigger the ``on_close()`` function. The highlighted rows show the lines added exclusively in the second example. This threading approach is identical to the `echoapp_client.py example <https://github.com/websocket-client/websocket-client/blob/master/examples/echoapp_client.py>`_. However, further testing found that some WebSocket servers, such as -ws://echo.websocket.org, do not trigger the ``on_close()`` function. +ws://echo.websocket.events, do not trigger the ``on_close()`` function. **NOT working on_close() example, without threading** diff --git a/websocket/_core.py b/websocket/_core.py index 73d38b1..1d68829 100644 --- a/websocket/_core.py +++ b/websocket/_core.py @@ -46,8 +46,11 @@ class WebSocket: >>> import websocket >>> ws = websocket.WebSocket() - >>> ws.connect("ws://echo.websocket.org") + >>> ws.connect("ws://echo.websocket.events") + >>> ws.recv() + 'echo.websocket.events sponsored by Lob.com' >>> ws.send("Hello, Server") + 19 >>> ws.recv() 'Hello, Server' >>> ws.close() @@ -203,7 +206,7 @@ class WebSocket: If you set "header" list object, you can set your own custom header. >>> ws = WebSocket() - >>> ws.connect("ws://echo.websocket.org/", + >>> ws.connect("ws://echo.websocket.events", ... header=["User-Agent: MyProgram", ... "x-custom: header"]) @@ -283,7 +286,7 @@ class WebSocket: """ Send the data frame. - >>> ws = create_connection("ws://echo.websocket.org/") + >>> ws = create_connection("ws://echo.websocket.events") >>> frame = ABNF.create_frame("Hello", ABNF.OPCODE_TEXT) >>> ws.send_frame(frame) >>> cont_frame = ABNF.create_frame("My name is ", ABNF.OPCODE_CONT, 0) @@ -543,7 +546,7 @@ def create_connection(url, timeout=None, class_=WebSocket, **options): You can customize using 'options'. If you set "header" list object, you can set your own custom header. - >>> conn = create_connection("ws://echo.websocket.org/", + >>> conn = create_connection("ws://echo.websocket.events", ... header=["User-Agent: MyProgram", ... "x-custom: header"]) diff --git a/websocket/tests/test_websocket.py b/websocket/tests/test_websocket.py index ae42ab5..d47d73e 100644 --- a/websocket/tests/test_websocket.py +++ b/websocket/tests/test_websocket.py @@ -432,7 +432,7 @@ class HandshakeTest(unittest.TestCase): self.assertRaises(ws._exceptions.WebSocketBadStatusException, websock3.connect, "wss://api.bitfinex.com/ws/2", cookie="chocolate", origin="testing_websockets.com", - host="echo.websocket.org/websocket-client-test", + host="echo.websocket.events/websocket-client-test", subprotocols=["testproto"], connection="Upgrade", header={"CustomHeader1":"123", |