Compare commits

...

16 commits

Author SHA1 Message Date
Roy Hyunjin Han
8aa519e095 Order goals 2016-01-19 23:12:33 -05:00
Roy Hyunjin Han
d3a5839678 Process issues 2016-01-05 09:10:16 -05:00
Roy Hyunjin Han
7e9f3c7343 Use six.string_types 2015-11-10 17:42:40 -05:00
Roy Hyunjin Han
4f04e6ca62 Replace basestring with str 2015-11-02 16:13:35 -05:00
Roy Hyunjin Han
fd88b9e096 Prepare for updates 2015-10-22 17:41:21 -04:00
Roy Hyunjin Han
1cd63a031b Add classifier 2015-06-01 16:16:32 -04:00
Roy Hyunjin Han
db59b16e25 Add documentation 2015-06-01 16:06:48 -04:00
Roy Hyunjin Han
ba82ffe558 Fix #80 2015-06-01 15:58:49 -04:00
Roy Hyunjin Han
59dcd02a91 Prepare for minor release 2015-06-01 14:31:46 -04:00
Roy Hyunjin Han
605194d515 Merge pull request #78 from mattporritt/issue77
Fix #77
2015-06-01 12:57:07 -04:00
Matt Porritt
689648ba32 fixing close method that is called as part of __del__. No longer throws error trying to call an attribute that will not exist if object fails during instantiation 2015-05-22 17:11:21 +10:00
Roy Hyunjin Han
29a3e0ebf6 Support Python 2.6 & 2.7 2015-05-20 23:12:11 -04:00
Roy Hyunjin Han
aeaad0c330 Merge pull request #75 from mattporritt/python34
explicitly set file open to use utf8 encoding in setup.py
2015-05-20 22:59:56 -04:00
Matt Porritt
12fa6c523b explicitly set file open to user utf8 encoding when setup.py parses README and CHANGES file. If this is not done some systems will throw unicode can't decode byte error 2015-05-19 15:09:22 +10:00
Roy Hyunjin Han
829e669403 Fix link 2015-05-15 22:48:33 -04:00
Roy Hyunjin Han
fb3b66115e Fix #74 thanks to @Nabla128k 2015-05-15 22:47:33 -04:00
7 changed files with 91 additions and 12 deletions

View file

@ -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
-----
- 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
0.5.6
-----
- Backported to support requests 0.8.2
0.5.5
-----
- Fixed reconnection in the event of server restart

18
LICENSE
View file

@ -1,7 +1,19 @@
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.

View file

@ -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.
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
------------
@ -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.
- `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.
- `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!

View file

@ -1,3 +1,48 @@
Implement rooms #65
Implement binary event
Implement binary ack
= Consider supporting both protocols in the same library
https://github.com/invisibleroads/socketIO-client/issues/95
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

View file

@ -1,3 +1,4 @@
import io
from os.path import abspath, dirname, join
from setuptools import find_packages, setup
@ -10,13 +11,14 @@ REQUIREMENTS = [
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',
'CHANGES.rst',
])
setup(
name='socketIO_client',
version='0.6.3',
version='0.6.5',
description='A socket.io client library',
long_description=DESCRIPTION,
license='MIT',
@ -24,6 +26,7 @@ setup(
'Intended Audience :: Developers',
'Programming Language :: Python',
'License :: OSI Approved :: MIT License',
'Development Status :: 5 - Production/Stable',
],
keywords='socket.io node.js',
author='Roy Hyunjin Han',

View file

@ -173,7 +173,10 @@ class EngineIO(LoggingMixin):
def _close(self):
self._wants_to_close = True
self._heartbeat_thread.halt()
try:
self._heartbeat_thread.halt()
except AttributeError:
pass
if not self._opened:
return
engineIO_packet_type = 1
@ -218,7 +221,7 @@ class EngineIO(LoggingMixin):
# Use ping/pong to unblock recv for polling transport
self._heartbeat_thread.hurry()
# Use timeout to unblock recv for websocket transport
self._transport.set_timeout(seconds)
self._transport.set_timeout(seconds=1)
# Listen
warning_screen = self._yield_warning_screen(seconds)
for elapsed_time in warning_screen:

View file

@ -6,6 +6,7 @@ import sys
import threading
import time
import websocket
from six import string_types
from .exceptions import ConnectionError, TimeoutError
from .parsers import (
@ -129,7 +130,7 @@ class WebsocketTransport(AbstractTransport):
proxy_url_pack.username, proxy_url_pack.password)
if http_session.verify:
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
else:
kw['ca_certs'] = http_session.cert[0]