Skip to content

Commit dbab81f

Browse files
committed
Adjusted readme
1 parent 4907501 commit dbab81f

1 file changed

Lines changed: 15 additions & 21 deletions

File tree

README.rst

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
.. image:: https://travis-ci.org/invisibleroads/socketIO-client.svg?branch=master
2-
:target: https://travis-ci.org/invisibleroads/socketIO-client
3-
4-
5-
socketIO-client
1+
socketIO-client-nexus
62
===============
73
Here is a `socket.io <http://socket.io>`_ client library for Python. You can use it to write test code for your socket.io server.
84

95
This is a forked version to implement the Socket.io 2.x changes. You can find the original `here <https://github.com/invisibleroads/socketIO-client>`_.
106

11-
Please note that this version implements `socket.io protocol 1.x <https://github.com/automattic/socket.io-protocol>`_, which is not backwards compatible. If you want to communicate using `socket.io protocol 0.9 <https://github.com/learnboost/socket.io-spec>`_ (which is compatible with `gevent-socketio <https://github.com/abourget/gevent-socketio>`_), please use `socketIO-client 0.5.7.2 <https://pypi.python.org/pypi/socketIO-client/0.5.7.2>`_.
12-
137

148
Installation
159
------------
@@ -24,7 +18,7 @@ Install the package in an isolated environment. ::
2418
source $VIRTUAL_ENV/bin/activate
2519

2620
# Install package
27-
pip install -U socketIO-client
21+
pip install -U socketIO-client-nexus
2822

2923

3024
Usage
@@ -36,8 +30,8 @@ Activate isolated environment. ::
3630

3731
Launch your socket.io server. ::
3832

39-
cd $(python -c "import os, socketIO_client;\
40-
print(os.path.dirname(socketIO_client.__file__))")
33+
cd $(python -c "import os, socketIO_client_nexus;\
34+
print(os.path.dirname(socketIO_client_nexus.__file__))")
4135

4236
DEBUG=* node tests/serve.js # Start socket.io server in terminal one
4337
DEBUG=* node tests/proxy.js # Start proxy server in terminal two
@@ -46,20 +40,20 @@ Launch your socket.io server. ::
4640
For debugging information, run these commands first. ::
4741

4842
import logging
49-
logging.getLogger('socketIO-client').setLevel(logging.DEBUG)
43+
logging.getLogger('socketIO-client-nexus').setLevel(logging.DEBUG)
5044
logging.basicConfig()
5145

5246
Emit. ::
5347

54-
from socketIO_client import SocketIO, LoggingNamespace
48+
from socketIO_client_nexus import SocketIO, LoggingNamespace
5549

5650
with SocketIO('localhost', 8000, LoggingNamespace) as socketIO:
5751
socketIO.emit('aaa')
5852
socketIO.wait(seconds=1)
5953

6054
Emit with callback. ::
6155

62-
from socketIO_client import SocketIO, LoggingNamespace
56+
from socketIO_client_nexus import SocketIO, LoggingNamespace
6357

6458
def on_bbb_response(*args):
6559
print('on_bbb_response', args)
@@ -70,7 +64,7 @@ Emit with callback. ::
7064

7165
Define events. ::
7266

73-
from socketIO_client import SocketIO, LoggingNamespace
67+
from socketIO_client_nexus import SocketIO, LoggingNamespace
7468

7569
def on_connect():
7670
print('connect')
@@ -108,7 +102,7 @@ Define events. ::
108102

109103
Define events in a namespace. ::
110104

111-
from socketIO_client import SocketIO, BaseNamespace
105+
from socketIO_client_nexus import SocketIO, BaseNamespace
112106

113107
class Namespace(BaseNamespace):
114108

@@ -122,7 +116,7 @@ Define events in a namespace. ::
122116

123117
Define standard events. ::
124118

125-
from socketIO_client import SocketIO, BaseNamespace
119+
from socketIO_client_nexus import SocketIO, BaseNamespace
126120

127121
class Namespace(BaseNamespace):
128122

@@ -140,7 +134,7 @@ Define standard events. ::
140134

141135
Define different namespaces on a single socket. ::
142136

143-
from socketIO_client import SocketIO, BaseNamespace
137+
from socketIO_client_nexus import SocketIO, BaseNamespace
144138

145139
class ChatNamespace(BaseNamespace):
146140

@@ -162,7 +156,7 @@ Define different namespaces on a single socket. ::
162156

163157
Connect via SSL (https://github.com/invisibleroads/socketIO-client/issues/54). ::
164158

165-
from socketIO_client import SocketIO
159+
from socketIO_client_nexus import SocketIO
166160

167161
# Skip server certificate verification
168162
SocketIO('https://localhost', verify=False)
@@ -174,7 +168,7 @@ Connect via SSL (https://github.com/invisibleroads/socketIO-client/issues/54). :
174168

175169
Specify params, headers, cookies, proxies thanks to the `requests <http://python-requests.org>`_ library. ::
176170

177-
from socketIO_client import SocketIO
171+
from socketIO_client_nexus import SocketIO
178172
from base64 import b64encode
179173

180174
SocketIO(
@@ -186,15 +180,15 @@ Specify params, headers, cookies, proxies thanks to the `requests <http://python
186180

187181
Wait forever. ::
188182

189-
from socketIO_client import SocketIO
183+
from socketIO_client_nexus import SocketIO
190184

191185
socketIO = SocketIO('localhost', 8000)
192186
socketIO.wait()
193187

194188
Don't wait forever. ::
195189

196190
from requests.exceptions import ConnectionError
197-
from socketIO_client import SocketIO
191+
from socketIO_client_nexus import SocketIO
198192

199193
try:
200194
socket = SocketIO('localhost', 8000, wait_for_connection=False)

0 commit comments

Comments
 (0)