Compare commits
16 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8aa519e095 | ||
|
|
d3a5839678 | ||
|
|
7e9f3c7343 | ||
|
|
4f04e6ca62 | ||
|
|
fd88b9e096 | ||
|
|
1cd63a031b | ||
|
|
db59b16e25 | ||
|
|
ba82ffe558 | ||
|
|
59dcd02a91 | ||
|
|
605194d515 | ||
|
|
689648ba32 | ||
|
|
29a3e0ebf6 | ||
|
|
aeaad0c330 | ||
|
|
12fa6c523b | ||
|
|
829e669403 | ||
|
|
fb3b66115e |
7 changed files with 91 additions and 12 deletions
13
CHANGES.rst
13
CHANGES.rst
|
|
@ -1,3 +1,12 @@
|
||||||
|
0.6.5
|
||||||
|
-----
|
||||||
|
- Updated wait loop to be more responsive under websocket transport
|
||||||
|
|
||||||
|
0.6.4
|
||||||
|
-----
|
||||||
|
- Fixed support for Python 3
|
||||||
|
- Fixed thread cleanup
|
||||||
|
|
||||||
0.6.3
|
0.6.3
|
||||||
-----
|
-----
|
||||||
- Upgraded to socket.io protocol 1.x for websocket transport
|
- Upgraded to socket.io protocol 1.x for websocket transport
|
||||||
|
|
@ -8,6 +17,10 @@
|
||||||
-----
|
-----
|
||||||
- Upgraded to socket.io protocol 1.x thanks to Sean Arietta and Joe Palmer
|
- Upgraded to socket.io protocol 1.x thanks to Sean Arietta and Joe Palmer
|
||||||
|
|
||||||
|
0.5.6
|
||||||
|
-----
|
||||||
|
- Backported to support requests 0.8.2
|
||||||
|
|
||||||
0.5.5
|
0.5.5
|
||||||
-----
|
-----
|
||||||
- Fixed reconnection in the event of server restart
|
- Fixed reconnection in the event of server restart
|
||||||
|
|
|
||||||
18
LICENSE
18
LICENSE
|
|
@ -1,7 +1,19 @@
|
||||||
Copyright (c) 2013 Roy Hyunjin Han and contributors
|
Copyright (c) 2013 Roy Hyunjin Han and contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ socketIO-client
|
||||||
===============
|
===============
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
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.6 <https://pypi.python.org/pypi/socketIO-client/0.5.6>`_.
|
||||||
|
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|
@ -164,5 +166,5 @@ Credits
|
||||||
- `Alexandre Bourget <https://github.com/abourget>`_ wrote `gevent-socketio <https://github.com/abourget/gevent-socketio>`_, which is a socket.io server written in Python.
|
- `Alexandre Bourget <https://github.com/abourget>`_ wrote `gevent-socketio <https://github.com/abourget/gevent-socketio>`_, which is a socket.io server written in Python.
|
||||||
- `Paul Kienzle <https://github.com/pkienzle>`_, `Zac Lee <https://github.com/zratic>`_, `Josh VanderLinden <https://github.com/codekoala>`_, `Ian Fitzpatrick <https://github.com/ifitzpatrick>`_, `Lucas Klein <https://github.com/lukasklein>`_, `Rui Chicoria <https://github.com/rchicoria>`_, `Travis Odom <https://github.com/burstaholic>`_, `Patrick Huber <https://github.com/stackmagic>`_, `Brad Campbell <https://github.com/bradjc>`_, `Daniel <https://github.com/dabidan>`_, `Sean Arietta <https://github.com/sarietta>`_ submitted code to expand support of the socket.io protocol.
|
- `Paul Kienzle <https://github.com/pkienzle>`_, `Zac Lee <https://github.com/zratic>`_, `Josh VanderLinden <https://github.com/codekoala>`_, `Ian Fitzpatrick <https://github.com/ifitzpatrick>`_, `Lucas Klein <https://github.com/lukasklein>`_, `Rui Chicoria <https://github.com/rchicoria>`_, `Travis Odom <https://github.com/burstaholic>`_, `Patrick Huber <https://github.com/stackmagic>`_, `Brad Campbell <https://github.com/bradjc>`_, `Daniel <https://github.com/dabidan>`_, `Sean Arietta <https://github.com/sarietta>`_ submitted code to expand support of the socket.io protocol.
|
||||||
- `Bernard Pratz <https://github.com/guyzmo>`_, `Francis Bull <https://github.com/franbull>`_ wrote prototypes to support xhr-polling and jsonp-polling.
|
- `Bernard Pratz <https://github.com/guyzmo>`_, `Francis Bull <https://github.com/franbull>`_ wrote prototypes to support xhr-polling and jsonp-polling.
|
||||||
- `Eric Chen <https://github.com/taiyangc>`_, `Denis Zinevich <https://github.com/dzinevich>`_, `Thiago Hersan <https://github.com/thiagohersan>`_, `Nayef Copty <https://github.com/nayefc>`_, `Jörgen Karlsson <https://github.com/jorgen-k>`_, `Branden Ghena <https://github.com/brghena>`_ suggested ways to make the connection more robust.
|
- `Eric Chen <https://github.com/taiyangc>`_, `Denis Zinevich <https://github.com/dzinevich>`_, `Thiago Hersan <https://github.com/thiagohersan>`_, `Nayef Copty <https://github.com/nayefc>`_, `Jörgen Karlsson <https://github.com/jorgen-k>`_, `Branden Ghena <https://github.com/brghena>`_, `Tim Landscheidt <https://github.com/scfc>`_, `Matt Porritt <https://github.com/mattporritt>`_ suggested ways to make the connection more robust.
|
||||||
- `Merlijn van Deen <https://github.com/valhallasw>`_, `Frederic Sureau <https://github.com/fredericsureau>`_, `Marcus Cobden <https://github.com/leth>`_, `Drew Hutchison <https://github.com/drewhutchison>`_, `wuurrd <https://github.com/wuurrd>`_, `Adam Kecer <https://github.com/amfg>`_, `Alex Monk <https://github.com/Krenair>`_, `Vishal P R <https://github.com/vishalwy>`_, `John Vandenberg <https://github.com/jayvdb>`_, `Thomas Grainger <https://github.com/graingert>`_ proposed changes that make the library more friendly and practical for you!
|
- `Merlijn van Deen <https://github.com/valhallasw>`_, `Frederic Sureau <https://github.com/fredericsureau>`_, `Marcus Cobden <https://github.com/leth>`_, `Drew Hutchison <https://github.com/drewhutchison>`_, `wuurrd <https://github.com/wuurrd>`_, `Adam Kecer <https://github.com/amfg>`_, `Alex Monk <https://github.com/Krenair>`_, `Vishal P R <https://github.com/vishalwy>`_, `John Vandenberg <https://github.com/jayvdb>`_, `Thomas Grainger <https://github.com/graingert>`_ proposed changes that make the library more friendly and practical for you!
|
||||||
|
|
|
||||||
51
TODO.goals
51
TODO.goals
|
|
@ -1,3 +1,48 @@
|
||||||
Implement rooms #65
|
= Consider supporting both protocols in the same library
|
||||||
Implement binary event
|
https://github.com/invisibleroads/socketIO-client/issues/95
|
||||||
Implement binary ack
|
Add binary support
|
||||||
|
https://github.com/invisibleroads/socketIO-client/pull/85
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/70
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/71
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/91
|
||||||
|
Check requests dependency
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/92
|
||||||
|
https://github.com/invisibleroads/socketIO-client/pull/93
|
||||||
|
https://github.com/invisibleroads/socketIO-client/commit/b288d89c15d452a30bfeb00f38494f59f71f5a43
|
||||||
|
Check SSL
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/86
|
||||||
|
https://github.com/invisibleroads/socketIO-client/pull/87
|
||||||
|
Look into invalid namespace handling
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/84
|
||||||
|
Check unicode issues
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/81
|
||||||
|
Check python3 support for socketIO-client 0.5.6
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/83
|
||||||
|
Check OK assertion
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/99
|
||||||
|
https://github.com/invisibleroads/socketIO-client/pull/103
|
||||||
|
Check why connected=True after termination
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/80
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/98
|
||||||
|
Consider catching heartbeat thread exception
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/100
|
||||||
|
Check why it blocks when defining a namespace
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/96
|
||||||
|
Check why transports are not being set
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/102
|
||||||
|
Look at 404 not found error
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/101
|
||||||
|
Look at socketio off and socketio once
|
||||||
|
https://github.com/invisibleroads/socketIO-client/pull/94
|
||||||
|
Implement rooms
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/72
|
||||||
|
https://github.com/invisibleroads/socketIO-client/pull/65
|
||||||
|
Check tests
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/90
|
||||||
|
Check whether it works on Windows 8
|
||||||
|
https://github.com/invisibleroads/socketIO-client/issues/97
|
||||||
|
Add debian packaging support
|
||||||
|
https://github.com/invisibleroads/socketIO-client/pull/89
|
||||||
|
|
||||||
|
+ Review issues and pull requests
|
||||||
|
+ Order issues
|
||||||
|
|
|
||||||
7
setup.py
7
setup.py
|
|
@ -1,3 +1,4 @@
|
||||||
|
import io
|
||||||
from os.path import abspath, dirname, join
|
from os.path import abspath, dirname, join
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
|
|
@ -10,13 +11,14 @@ REQUIREMENTS = [
|
||||||
|
|
||||||
|
|
||||||
HERE = dirname(abspath(__file__))
|
HERE = dirname(abspath(__file__))
|
||||||
DESCRIPTION = '\n\n'.join(open(join(HERE, _)).read() for _ in [
|
LOAD_TEXT = lambda name: io.open(join(HERE, name), encoding='UTF-8').read()
|
||||||
|
DESCRIPTION = '\n\n'.join(LOAD_TEXT(_) for _ in [
|
||||||
'README.rst',
|
'README.rst',
|
||||||
'CHANGES.rst',
|
'CHANGES.rst',
|
||||||
])
|
])
|
||||||
setup(
|
setup(
|
||||||
name='socketIO_client',
|
name='socketIO_client',
|
||||||
version='0.6.3',
|
version='0.6.5',
|
||||||
description='A socket.io client library',
|
description='A socket.io client library',
|
||||||
long_description=DESCRIPTION,
|
long_description=DESCRIPTION,
|
||||||
license='MIT',
|
license='MIT',
|
||||||
|
|
@ -24,6 +26,7 @@ setup(
|
||||||
'Intended Audience :: Developers',
|
'Intended Audience :: Developers',
|
||||||
'Programming Language :: Python',
|
'Programming Language :: Python',
|
||||||
'License :: OSI Approved :: MIT License',
|
'License :: OSI Approved :: MIT License',
|
||||||
|
'Development Status :: 5 - Production/Stable',
|
||||||
],
|
],
|
||||||
keywords='socket.io node.js',
|
keywords='socket.io node.js',
|
||||||
author='Roy Hyunjin Han',
|
author='Roy Hyunjin Han',
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,10 @@ class EngineIO(LoggingMixin):
|
||||||
|
|
||||||
def _close(self):
|
def _close(self):
|
||||||
self._wants_to_close = True
|
self._wants_to_close = True
|
||||||
self._heartbeat_thread.halt()
|
try:
|
||||||
|
self._heartbeat_thread.halt()
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
if not self._opened:
|
if not self._opened:
|
||||||
return
|
return
|
||||||
engineIO_packet_type = 1
|
engineIO_packet_type = 1
|
||||||
|
|
@ -218,7 +221,7 @@ class EngineIO(LoggingMixin):
|
||||||
# Use ping/pong to unblock recv for polling transport
|
# Use ping/pong to unblock recv for polling transport
|
||||||
self._heartbeat_thread.hurry()
|
self._heartbeat_thread.hurry()
|
||||||
# Use timeout to unblock recv for websocket transport
|
# Use timeout to unblock recv for websocket transport
|
||||||
self._transport.set_timeout(seconds)
|
self._transport.set_timeout(seconds=1)
|
||||||
# Listen
|
# Listen
|
||||||
warning_screen = self._yield_warning_screen(seconds)
|
warning_screen = self._yield_warning_screen(seconds)
|
||||||
for elapsed_time in warning_screen:
|
for elapsed_time in warning_screen:
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import sys
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
import websocket
|
import websocket
|
||||||
|
from six import string_types
|
||||||
|
|
||||||
from .exceptions import ConnectionError, TimeoutError
|
from .exceptions import ConnectionError, TimeoutError
|
||||||
from .parsers import (
|
from .parsers import (
|
||||||
|
|
@ -129,7 +130,7 @@ class WebsocketTransport(AbstractTransport):
|
||||||
proxy_url_pack.username, proxy_url_pack.password)
|
proxy_url_pack.username, proxy_url_pack.password)
|
||||||
if http_session.verify:
|
if http_session.verify:
|
||||||
if http_session.cert: # Specify certificate path on disk
|
if http_session.cert: # Specify certificate path on disk
|
||||||
if isinstance(http_session.cert, basestring):
|
if isinstance(http_session.cert, string_types):
|
||||||
kw['ca_certs'] = http_session.cert
|
kw['ca_certs'] = http_session.cert
|
||||||
else:
|
else:
|
||||||
kw['ca_certs'] = http_session.cert[0]
|
kw['ca_certs'] = http_session.cert[0]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue