changed the echo server URL so that we can test without running a local echo server
This commit is contained in:
@@ -24,7 +24,7 @@ Example
|
|||||||
Low Level API example::
|
Low Level API example::
|
||||||
|
|
||||||
from websocket import create_connection
|
from websocket import create_connection
|
||||||
ws = create_connection("ws://localhost:5000/echo")
|
ws = create_connection("ws://echo.websocket.org/")
|
||||||
print "Sending 'Hello, World'..."
|
print "Sending 'Hello, World'..."
|
||||||
ws.send("Hello, World")
|
ws.send("Hello, World")
|
||||||
print "Sent"
|
print "Sent"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import websocket
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
websocket.enableTrace(True)
|
websocket.enableTrace(True)
|
||||||
ws = websocket.create_connection("ws://localhost:5000/chat")
|
ws = websocket.create_connection("ws://echo.websocket.org/")
|
||||||
print "Sending 'Hello, World'..."
|
print "Sending 'Hello, World'..."
|
||||||
ws.send("Hello, World")
|
ws.send("Hello, World")
|
||||||
print "Sent"
|
print "Sent"
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class WebSocket(object):
|
|||||||
|
|
||||||
>>> import websocket
|
>>> import websocket
|
||||||
>>> ws = websocket.WebSocket()
|
>>> ws = websocket.WebSocket()
|
||||||
>>> ws.Connect("ws://localhost:8080/echo")
|
>>> ws.Connect("ws://echo.websocket.org")
|
||||||
>>> ws.send("Hello, Server")
|
>>> ws.send("Hello, Server")
|
||||||
>>> ws.recv()
|
>>> ws.recv()
|
||||||
'Hello, Server'
|
'Hello, Server'
|
||||||
|
|||||||
Reference in New Issue
Block a user