{ "info": { "author": "John Feusi", "author_email": "feus4177@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python" ], "description": ".. image:: https://travis-ci.org/invisibleroads/socketIO-client.svg?branch=master\n :target: https://travis-ci.org/invisibleroads/socketIO-client\n\n\nsocketIO-client-2\n=================\nHere is a `socket.io `_ client library for Python. You can use it to write test code for your socket.io server.\n\nPlease note that this version implements `socket.io protocol 1.x `_, which is not backwards compatible. If you want to communicate using `socket.io protocol 0.9 `_ (which is compatible with `gevent-socketio `_), please use `socketIO-client 0.5.6 `_.\n\n\nInstallation\n------------\nInstall the package in an isolated environment. ::\n\n mkvirtualenv your_env_name\n pip install socketIO-client-2\n\n\nUsage\n-----\nActivate isolated environment. ::\n\n workon your_env_name\n\nLaunch your socket.io server or this provided test server. ::\n\n # Get package folder\n PACKAGE_FOLDER=`python -c \"import os, socketIO_client;\\\n print(os.path.dirname(socketIO_client.__file__))\"`\n # Install the server dependencies\n cd $PACKAGE_FOLDER/tests/\n npm install\n # Start socket.io server\n DEBUG=* node $PACKAGE_FOLDER/tests/serve.js\n # Start proxy server in a separate terminal on the same machine\n DEBUG=* node $PACKAGE_FOLDER/tests/proxy.js\n # To run the tests in a third terminal\n cd $PACKAGE_FOLDER\n nosetests --with-coverage --cover-package=socketIO_client tests/\n\nFor debugging information, run these commands first. ::\n\n import logging\n logging.getLogger('requests').setLevel(logging.WARNING)\n logging.basicConfig(level=logging.DEBUG)\n\nEmit. ::\n\n from socketIO_client import SocketIO, LoggingNamespace\n\n with SocketIO('localhost', 8000, LoggingNamespace) as socketIO:\n socketIO.emit('aaa')\n socketIO.wait(seconds=1)\n\nEmit with callback. ::\n\n from socketIO_client import SocketIO, LoggingNamespace\n\n def on_bbb_response(*args):\n print('on_bbb_response', args)\n\n with SocketIO('localhost', 8000, LoggingNamespace) as socketIO:\n socketIO.emit('bbb', {'xxx': 'yyy'}, on_bbb_response)\n socketIO.wait_for_callbacks(seconds=1)\n\nDefine events. ::\n\n from socketIO_client import SocketIO, LoggingNamespace\n\n def on_aaa_response(*args):\n print('on_aaa_response', args)\n\n socketIO = SocketIO('localhost', 8000, LoggingNamespace)\n socketIO.on('aaa_response', on_aaa_response)\n socketIO.emit('aaa')\n socketIO.wait(seconds=1)\n\nDefine events in a namespace. ::\n\n from socketIO_client import SocketIO, BaseNamespace\n\n class Namespace(BaseNamespace):\n\n def on_aaa_response(self, *args):\n print('on_aaa_response', args)\n self.emit('bbb')\n\n socketIO = SocketIO('localhost', 8000, Namespace)\n socketIO.emit('aaa')\n socketIO.wait(seconds=1)\n\nDefine standard events. ::\n\n from socketIO_client import SocketIO, BaseNamespace\n\n class Namespace(BaseNamespace):\n\n def on_connect(self):\n print('[Connected]')\n\n socketIO = SocketIO('localhost', 8000, Namespace)\n socketIO.wait(seconds=1)\n\nDefine different namespaces on a single socket. ::\n\n from socketIO_client import SocketIO, BaseNamespace\n\n class ChatNamespace(BaseNamespace):\n\n def on_aaa_response(self, *args):\n print('on_aaa_response', args)\n\n class NewsNamespace(BaseNamespace):\n\n def on_aaa_response(self, *args):\n print('on_aaa_response', args)\n\n socketIO = SocketIO('localhost', 8000)\n chat_namespace = socketIO.define(ChatNamespace, '/chat')\n news_namespace = socketIO.define(NewsNamespace, '/news')\n\n chat_namespace.emit('aaa')\n news_namespace.emit('aaa')\n socketIO.wait(seconds=1)\n\nConnect via SSL. ::\n\n from socketIO_client import SocketIO\n\n SocketIO('https://localhost', verify=False)\n\nSpecify params, headers, cookies, proxies thanks to the `requests `_ library. ::\n\n from socketIO_client import SocketIO\n from base64 import b64encode\n\n SocketIO(\n localhost', 8000,\n params={'q': 'qqq'},\n headers={'Authorization': 'Basic ' + b64encode('username:password')},\n cookies={'a': 'aaa'},\n proxies={'https': 'https://proxy.example.com:8080'})\n\nWait forever. ::\n\n from socketIO_client import SocketIO\n\n socketIO = SocketIO('localhost', 8000)\n socketIO.wait()\n\n\nContributing\n------------\nI am following the `git-flow ` model put forward by Vincent Driessen. Therefore I ask that you make pull requests to the develop branch. Also, I am supporting Python 2.6, 2.7, and 3.4 so please make sure that your changes are compatible with all three versions. Travis-CI is setup to automatically run the tests with all three Python versions on pull-requests so if you add tests to cover any changes you made then you should be able to see if they are compatible.\n\n\nLicense\n-------\nThis software is available under the MIT License.\n\n\nCredits\n-------\n- `Guillermo Rauch `_ wrote the `socket.io specification `_.\n- `Hiroki Ohtani `_ wrote `websocket-client `_.\n- `rod `_ wrote a `prototype for a Python client to a socket.io server `_.\n- `Alexandre Bourget `_ wrote `gevent-socketio `_, which is a socket.io server written in Python.\n- `Paul Kienzle `_, `Zac Lee `_, `Josh VanderLinden `_, `Ian Fitzpatrick `_, `Lucas Klein `_, `Rui Chicoria `_, `Travis Odom `_, `Patrick Huber `_, `Brad Campbell `_, `Daniel `_, `Sean Arietta `_ submitted code to expand support of the socket.io protocol.\n- `Bernard Pratz `_, `Francis Bull `_ wrote prototypes to support xhr-polling and jsonp-polling.\n- `Eric Chen `_, `Denis Zinevich `_, `Thiago Hersan `_, `Nayef Copty `_, `J\u00f6rgen Karlsson `_, `Branden Ghena `_, `Tim Landscheidt `_, `Matt Porritt `_ suggested ways to make the connection more robust.\n- `Merlijn van Deen `_, `Frederic Sureau `_, `Marcus Cobden `_, `Drew Hutchison `_, `wuurrd `_, `Adam Kecer `_, `Alex Monk `_, `Vishal P R `_, `John Vandenberg `_, `Thomas Grainger `_ proposed changes that make the library more friendly and practical for you!\n\n\n0.7.2\n-----\n- NamespaceLogging fix\n\n0.7.1\n-----\n- Updated instructions\n\n0.7.0\n-----\n- Forked package\n- Added binary support\n\n0.6.5\n-----\n- Updated wait loop to be more responsive under websocket transport\n\n0.6.4\n-----\n- Fixed support for Python 3\n- Fixed thread cleanup\n\n0.6.3\n-----\n- Upgraded to socket.io protocol 1.x for websocket transport\n- Added locks to fix concurrency issues with polling transport\n- Fixed SSL support\n\n0.6.1\n-----\n- Upgraded to socket.io protocol 1.x thanks to Sean Arietta and Joe Palmer\n\n0.5.6\n-----\n- Backported to support requests 0.8.2\n\n0.5.5\n-----\n- Fixed reconnection in the event of server restart\n- Fixed calling on_reconnect() so that it is actually called\n- Set default Namespace=None\n- Added support for Python 3.4\n\n0.5.3\n-----\n- Updated wait loop to exit if the client wants to disconnect\n- Fixed calling on_connect() so that it is called only once\n- Set heartbeat_interval to be half of the heartbeat_timeout\n\n0.5.2\n-----\n- Replaced secure=True with host='https://example.com'\n- Fixed sending heartbeats thanks to Travis Odom\n\n0.5.1\n-----\n- Added error handling in the event of websocket timeout\n- Fixed sending acknowledgments in custom namespaces thanks to Travis Odom\n\n0.5\n---\n- Rewrote library to use coroutines instead of threads to save memory\n- Improved connection resilience\n- Added support for xhr-polling thanks to Francis Bull\n- Added support for jsonp-polling thanks to Bernard Pratz\n- Added support for query params and cookies\n\n0.4\n---\n- Added support for custom headers and proxies thanks to Rui and Sajal\n- Added support for server-side callbacks thanks to Zac Lee\n- Added low-level _SocketIO to remove cyclic references\n- Merged Channel functionality into BaseNamespace thanks to Alexandre Bourget\n\n0.3\n---\n- Added support for secure connections\n- Added socketIO.wait()\n- Improved exception handling in _RhythmicThread and _ListenerThread\n\n0.2\n---\n- Added support for callbacks and channels thanks to Paul Kienzle\n- Incorporated suggestions from Josh VanderLinden and Ian Fitzpatrick\n\n0.1\n---\n- Wrapped `code from StackOverflow `_\n- Added exception handling to destructor in case of connection failure", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/feus4177/socketIO-client-2", "keywords": "socket.io node.js", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "socketIO-client-2", "package_url": "https://pypi.org/project/socketIO-client-2/", "platform": "", "project_url": "https://pypi.org/project/socketIO-client-2/", "project_urls": { "Homepage": "https://github.com/feus4177/socketIO-client-2" }, "release_url": "https://pypi.org/project/socketIO-client-2/0.7.5/", "requires_dist": null, "requires_python": "", "summary": "A socket.io client library", "version": "0.7.5" }, "last_serial": 3085560, "releases": { "0.7.0": [ { "comment_text": "", "digests": { "md5": "b13431ac47c2589bd43a39f0f005c163", "sha256": "cb9b3b3a6acf0e2ca7208dabcae2c8cdef97ff2f3d3e923ddfd9573da0a130a9" }, "downloads": -1, "filename": "socketIO-client-2-0.7.0.tar.gz", "has_sig": false, "md5_digest": "b13431ac47c2589bd43a39f0f005c163", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22490, "upload_time": "2016-02-27T04:59:08", "url": "https://files.pythonhosted.org/packages/30/7b/75213cc75b388a17919cbc46a184a10e53ee5c47c1ae25ed9b44ffc56203/socketIO-client-2-0.7.0.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "c32e6039cb7f97cf7441867795a1c8bf", "sha256": "d212c5822be0fad2c7d0f6608e837f267a1c669e18159b91276e306555689a0c" }, "downloads": -1, "filename": "socketIO-client-2-0.7.1.tar.gz", "has_sig": false, "md5_digest": "c32e6039cb7f97cf7441867795a1c8bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22325, "upload_time": "2016-02-27T05:12:51", "url": "https://files.pythonhosted.org/packages/a4/e2/ffbc3a69c0a904cb13116880c5175d210e8ceeadcfe7605c5f532b7306a6/socketIO-client-2-0.7.1.tar.gz" } ], "0.7.2": [ { "comment_text": "", "digests": { "md5": "7c6c87066ae83d3a2b3b4a7b6a41b4ee", "sha256": "d33ca561afae238d0c26a0db280d53aeaf5d9bac105783b89d058de8702bbe2b" }, "downloads": -1, "filename": "socketIO-client-2-0.7.2.tar.gz", "has_sig": false, "md5_digest": "7c6c87066ae83d3a2b3b4a7b6a41b4ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 600614, "upload_time": "2016-03-07T18:53:38", "url": "https://files.pythonhosted.org/packages/07/85/da0df37f9f905375a64f804790f1a5b49bc24068354f676ee870f992ee8a/socketIO-client-2-0.7.2.tar.gz" } ], "0.7.3": [ { "comment_text": "", "digests": { "md5": "448b1d8b895fa149d1053ca6e4647c19", "sha256": "0514e3ef63f36b50bee5b14eaa44547a1c630b4a2bf2134a4db957f7428fbfaa" }, "downloads": -1, "filename": "socketIO-client-2-0.7.3.tar.gz", "has_sig": false, "md5_digest": "448b1d8b895fa149d1053ca6e4647c19", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 600739, "upload_time": "2017-01-14T21:46:31", "url": "https://files.pythonhosted.org/packages/92/61/453376bbe04e7ba9b40edb3fc24a6555ad8c6189c6ca75c8f0c357f4baa4/socketIO-client-2-0.7.3.tar.gz" } ], "0.7.4": [ { "comment_text": "", "digests": { "md5": "224288a89415c0304dca5d9f7dc6ed4b", "sha256": "d6be0f1101c2d655006f5b5d54ff4ba9611145325f55307ef42f21703eb4a790" }, "downloads": -1, "filename": "socketIO-client-2-0.7.4.tar.gz", "has_sig": false, "md5_digest": "224288a89415c0304dca5d9f7dc6ed4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 600873, "upload_time": "2017-01-14T21:46:56", "url": "https://files.pythonhosted.org/packages/00/58/757e3b8f227a02fd36d3a00d3b32326d48a37efddba2248beae5cc0842e0/socketIO-client-2-0.7.4.tar.gz" } ], "0.7.5": [ { "comment_text": "", "digests": { "md5": "994c7eb842c8fed63660b831081d6295", "sha256": "6a493c46d830200774b72f4859fe5a0b85ba98c83fd650db31e082fb5bf6c933" }, "downloads": -1, "filename": "socketIO-client-2-0.7.5.tar.gz", "has_sig": false, "md5_digest": "994c7eb842c8fed63660b831081d6295", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 600986, "upload_time": "2017-08-10T01:54:49", "url": "https://files.pythonhosted.org/packages/b3/89/90701efc6bc72d3445c8b5806b2277b74ec6c9de4f5ba19b0cbd4fe5ee8c/socketIO-client-2-0.7.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "994c7eb842c8fed63660b831081d6295", "sha256": "6a493c46d830200774b72f4859fe5a0b85ba98c83fd650db31e082fb5bf6c933" }, "downloads": -1, "filename": "socketIO-client-2-0.7.5.tar.gz", "has_sig": false, "md5_digest": "994c7eb842c8fed63660b831081d6295", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 600986, "upload_time": "2017-08-10T01:54:49", "url": "https://files.pythonhosted.org/packages/b3/89/90701efc6bc72d3445c8b5806b2277b74ec6c9de4f5ba19b0cbd4fe5ee8c/socketIO-client-2-0.7.5.tar.gz" } ] }