Wrapped code from http://stackoverflow.com/questions/6692908/formatting-messages-to-send-to-socket-io-node-js-server-from-python-client/
This commit is contained in:
commit
6a73a57bc3
12 changed files with 211 additions and 0 deletions
36
README.rst
Normal file
36
README.rst
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
socketIO.client
|
||||
===============
|
||||
Here is a barebones `socket.io <http://socket.io>`_ client library for Python.
|
||||
|
||||
Thanks to `rod <http://stackoverflow.com/users/370115/rod>`_ for his `StackOverflow question and answer <http://stackoverflow.com/questions/6692908/formatting-messages-to-send-to-socket-io-node-js-server-from-python-client/>`_, on which this code is based.
|
||||
|
||||
Thanks also to `liris <https://github.com/liris>`_ for his `websocket-client <https://github.com/liris/websocket-client>`_ and to `guille <https://github.com/guille>`_ for the `socket.io specification <https://github.com/LearnBoost/socket.io-spec>`_.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
::
|
||||
|
||||
# Prepare isolated environment
|
||||
ENV=$HOME/Projects/env
|
||||
virtualenv $ENV
|
||||
mkdir $ENV/opt
|
||||
|
||||
# Activate isolated environment
|
||||
source $ENV/bin/activate
|
||||
|
||||
# Install package
|
||||
easy_install -U socketIO-client
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
::
|
||||
|
||||
ENV=$HOME/Projects/env
|
||||
source $ENV/bin/activate
|
||||
python
|
||||
|
||||
from socketIO import SocketIO
|
||||
s = SocketIO('localhost', 8000)
|
||||
s.emit('news', {'hello': 'world'})
|
||||
Loading…
Add table
Add a link
Reference in a new issue