28 lines
698 B
Plaintext
28 lines
698 B
Plaintext
=================
|
|
websocket-client
|
|
=================
|
|
|
|
websocket-client module is WebSocket client for python. This provide the low level APIs for WebSocket. All APIs are the synchronous functions.
|
|
|
|
Installation
|
|
=============
|
|
|
|
This module is tested on only Python 2.7.
|
|
Type "python setup.py install" or "pip install websocket-client" to install.
|
|
|
|
This module does not depend on any other module.
|
|
|
|
Example
|
|
========
|
|
|
|
::
|
|
from websocket import create_connection
|
|
ws = create_connection("ws://localhost:5000/echo")
|
|
print "Sending 'Hello, World'..."
|
|
ws.send("Hello, World")
|
|
print "Sent"
|
|
print "Reeiving..."
|
|
result = ws.recv()
|
|
print "Received '%s'" % result
|
|
ws.close()
|