{ "info": { "author": "Roy Hyunjin Han", "author_email": "rhh@crosscompute.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\n===============\nHere is a `socket.io `_ client library for Python. You can use it to write test code for your socket.io server.\n\nThis is a forked version to implement the Socket.io 2.x changes. You can find the original `here `_.\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.7.2 `_.\n\n\nInstallation\n------------\nInstall the package in an isolated environment. ::\n\n VIRTUAL_ENV=$HOME/.virtualenv\n\n # Prepare isolated environment\n virtualenv $VIRTUAL_ENV\n\n # Activate isolated environment\n source $VIRTUAL_ENV/bin/activate\n\n # Install package\n pip install -U socketIO-client\n\n\nUsage\n-----\nActivate isolated environment. ::\n\n VIRTUAL_ENV=$HOME/.virtualenv\n source $VIRTUAL_ENV/bin/activate\n\nLaunch your socket.io server. ::\n\n cd $(python -c \"import os, socketIO_client;\\\n print(os.path.dirname(socketIO_client.__file__))\")\n\n DEBUG=* node tests/serve.js # Start socket.io server in terminal one\n DEBUG=* node tests/proxy.js # Start proxy server in terminal two\n nosetests # Run tests in terminal three\n\nFor debugging information, run these commands first. ::\n\n import logging\n logging.getLogger('socketIO-client').setLevel(logging.DEBUG)\n logging.basicConfig()\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_connect():\n print('connect')\n\n def on_disconnect():\n print('disconnect')\n\n def on_reconnect():\n print('reconnect')\n\n def on_aaa_response(*args):\n print('on_aaa_response', args)\n\n socketIO = SocketIO('localhost', 8000, LoggingNamespace)\n socketIO.on('connect', on_connect)\n socketIO.on('disconnect', on_disconnect)\n socketIO.on('reconnect', on_reconnect)\n\n # Listen\n socketIO.on('aaa_response', on_aaa_response)\n socketIO.emit('aaa')\n socketIO.emit('aaa')\n socketIO.wait(seconds=1)\n\n # Stop listening\n socketIO.off('aaa_response')\n socketIO.emit('aaa')\n socketIO.wait(seconds=1)\n\n # Listen only once\n socketIO.once('aaa_response', on_aaa_response)\n socketIO.emit('aaa') # Activate aaa_response\n socketIO.emit('aaa') # Ignore\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 def on_reconnect(self):\n print('[Reconnected]')\n\n def on_disconnect(self):\n print('[Disconnected]')\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 (https://github.com/invisibleroads/socketIO-client/issues/54). ::\n\n from socketIO_client import SocketIO\n\n # Skip server certificate verification\n SocketIO('https://localhost', verify=False)\n # Verify the server certificate\n SocketIO('https://localhost', verify='server.crt')\n # Verify the server certificate and encrypt using client certificate\n socketIO = SocketIO('https://localhost', verify='server.crt', cert=(\n 'client.crt', 'client.key'))\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\nDon't wait forever. ::\n\n from requests.exceptions import ConnectionError\n from socketIO_client import SocketIO\n\n try:\n socket = SocketIO('localhost', 8000, wait_for_connection=False)\n socket.wait()\n except ConnectionError:\n print('The server is down. Try again later.')\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- `Roderick Hodgson `_ 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 `_, `Sacha Stafyniak `_ 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- `Joe Palmer `_ sponsored development.\n- `Eric Chen `_, `Denis Zinevich `_, `Thiago Hersan `_, `Nayef Copty `_, `J\u00f6rgen Karlsson `_, `Branden Ghena `_, `Tim Landscheidt `_, `Matt Porritt `_, `Matt Dainty `_, `Thomaz de Oliveira dos Reis `_, `Felix K\u00f6nig `_, `George Wilson `_, `Andreas Strikos `_, `Alessio Sergi `_ `Claudio Yacarini `_, `Khairi Hafsham `_, `Robbie Clarken `_ 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 `_, `Daniel Quinn `_, `Adric Worley `_, `Adam Roses Wight `_, `Jan V\u010del\u00e1k `_ proposed changes that make the library more friendly and practical for you!\n\n\n0.7\n---\n- Fixed thread cleanup\n- Fixed disconnect detection if defined directly thanks to Andreas Strikos\n- Fixed support for unicode payloads\n\n0.6\n---\n- Upgraded to socket.io protocol 1.x thanks to Sean Arietta and Joe Palmer\n- Fixed support for Python 3\n- Fixed SSL support\n- Added locks to fix concurrency issues with polling transport\n- Added SocketIO.off() and SocketIO.once()\n\n0.5\n---\n- Added support for Python 3\n- Added support for jsonp-polling thanks to Bernard Pratz\n- Added support for xhr-polling thanks to Francis Bull\n- Added support for query params and cookies\n- Fixed sending acknowledgments in custom namespaces thanks to Travis Odom\n- Rewrote library to use coroutines instead of threads to save memory\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- 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\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nexus-devs/socketIO-client", "keywords": "socket.io node.js", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "socketIO-client-nexus", "package_url": "https://pypi.org/project/socketIO-client-nexus/", "platform": "", "project_url": "https://pypi.org/project/socketIO-client-nexus/", "project_urls": { "Homepage": "https://github.com/nexus-devs/socketIO-client" }, "release_url": "https://pypi.org/project/socketIO-client-nexus/0.7.6/", "requires_dist": [ "requests (>=2.7.0)", "six", "websocket-client" ], "requires_python": "", "summary": "A socket.io client library", "version": "0.7.6" }, "last_serial": 3228543, "releases": { "0.7.3": [ { "comment_text": "", "digests": { "md5": "f7f6037ee33ba969e6f44aaf749fee3a", "sha256": "0e01a909af625dd83cef58c904c2fe0e4c1e7d0f899ab34bc690e269d051a696" }, "downloads": -1, "filename": "socketIO_client_nexus-0.7.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f7f6037ee33ba969e6f44aaf749fee3a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27351, "upload_time": "2017-06-12T18:20:15", "url": "https://files.pythonhosted.org/packages/8e/86/082b02a25b2d983e478a320389443d58ae470b7583ffb2ac5f5b4fbb0b9d/socketIO_client_nexus-0.7.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0572fac0517d4700b108a156d93507c1", "sha256": "77b412d59ed74d0b308207cf194458429b339358715182b2916f6282ff40f027" }, "downloads": -1, "filename": "socketIO-client-nexus-0.7.3.tar.gz", "has_sig": false, "md5_digest": "0572fac0517d4700b108a156d93507c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23834, "upload_time": "2017-06-12T18:20:17", "url": "https://files.pythonhosted.org/packages/dc/1b/37aac74bd88da22c8c0b15d7789e5fa866fb5135e821184258280ff30f7c/socketIO-client-nexus-0.7.3.tar.gz" } ], "0.7.4": [ { "comment_text": "", "digests": { "md5": "80c2b84b8e4c78f749b75be4495ffbcd", "sha256": "7454c8ff32b2f8fae6bc4c071ef0cab9ac603eca0a3f98257bd35809bd3606ff" }, "downloads": -1, "filename": "socketIO_client_nexus-0.7.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "80c2b84b8e4c78f749b75be4495ffbcd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 22352, "upload_time": "2017-06-12T18:45:34", "url": "https://files.pythonhosted.org/packages/e8/14/0523f3de3d289a1720a49f468f05f1e9f10313731e2b553b6b82ce618069/socketIO_client_nexus-0.7.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c6366cd9a326999963b421997b714291", "sha256": "96c5270cee329a7bd54a942f7d1d850f9e5f730ce0a26190b84e26cb2674fd76" }, "downloads": -1, "filename": "socketIO_client_nexus-0.7.4-py3-none-any.whl", "has_sig": false, "md5_digest": "c6366cd9a326999963b421997b714291", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 27544, "upload_time": "2017-06-13T13:20:52", "url": "https://files.pythonhosted.org/packages/2d/6f/b4571ec2cf3d9848f087ca520885c7d99b3584b2e2f4a411b10ea234239d/socketIO_client_nexus-0.7.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94afd6df8a0811712430a4dcd1a0a5cf", "sha256": "f0dfd3ca36effabd85400dd4e9b125b6072b786f8a9f8730c8cdfa6e65c25c16" }, "downloads": -1, "filename": "socketIO-client-nexus-0.7.4.tar.gz", "has_sig": false, "md5_digest": "94afd6df8a0811712430a4dcd1a0a5cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19837, "upload_time": "2017-06-12T18:45:37", "url": "https://files.pythonhosted.org/packages/5e/bd/abaef22b028588d9a91c1894688513aa6498e0927ed913f78cbd9250f405/socketIO-client-nexus-0.7.4.tar.gz" } ], "0.7.5": [ { "comment_text": "", "digests": { "md5": "709d3668a33a2c8e05a228f351796d90", "sha256": "f66be1e313c9e01db087883cef972e467906dfaa80e5d5d02b92f39fd6223943" }, "downloads": -1, "filename": "socketIO_client_nexus-0.7.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "709d3668a33a2c8e05a228f351796d90", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 22485, "upload_time": "2017-06-13T15:10:06", "url": "https://files.pythonhosted.org/packages/bd/f1/e815bb0aa749f3e0ec031b2eb5ec66886a1e014f86bbd6f55cd1d479a994/socketIO_client_nexus-0.7.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "51b32dfa0562152f591d717e307f0eed", "sha256": "5771cbcc0704535b240b70b672bff2290e4c6bf63fbf3ba8484aa4628bba2656" }, "downloads": -1, "filename": "socketIO-client-nexus-0.7.5.tar.gz", "has_sig": false, "md5_digest": "51b32dfa0562152f591d717e307f0eed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20110, "upload_time": "2017-06-13T15:10:11", "url": "https://files.pythonhosted.org/packages/4e/0b/428f1fe69fb841ab48ed86ae339daaad0b689317a8f1125bef6406f5e9af/socketIO-client-nexus-0.7.5.tar.gz" } ], "0.7.6": [ { "comment_text": "", "digests": { "md5": "37a2238ab854b68a3b3d5c4fd9a0fc41", "sha256": "9f44d705c38e405fcb334f95c1d5d5878a8daabdfeaca3ba56e974b69f42e643" }, "downloads": -1, "filename": "socketIO_client_nexus-0.7.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "37a2238ab854b68a3b3d5c4fd9a0fc41", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 22491, "upload_time": "2017-10-05T17:54:24", "url": "https://files.pythonhosted.org/packages/a0/fa/2bfd4b5f38530876a26678ed98e3f2233b33479d085cc01adf83af87c3f0/socketIO_client_nexus-0.7.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a0f84df9549e69a329b81e740b82b708", "sha256": "41e6aaaff981f6729690f472eb2c7a5d1dda07349077e34444527b9700b0aea5" }, "downloads": -1, "filename": "socketIO-client-nexus-0.7.6.tar.gz", "has_sig": false, "md5_digest": "a0f84df9549e69a329b81e740b82b708", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20128, "upload_time": "2017-10-05T17:54:26", "url": "https://files.pythonhosted.org/packages/ad/ec/5a328019992d77703fd7075e0dec80db01f2a040b831f0a7035ff5ba7fac/socketIO-client-nexus-0.7.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "37a2238ab854b68a3b3d5c4fd9a0fc41", "sha256": "9f44d705c38e405fcb334f95c1d5d5878a8daabdfeaca3ba56e974b69f42e643" }, "downloads": -1, "filename": "socketIO_client_nexus-0.7.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "37a2238ab854b68a3b3d5c4fd9a0fc41", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 22491, "upload_time": "2017-10-05T17:54:24", "url": "https://files.pythonhosted.org/packages/a0/fa/2bfd4b5f38530876a26678ed98e3f2233b33479d085cc01adf83af87c3f0/socketIO_client_nexus-0.7.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a0f84df9549e69a329b81e740b82b708", "sha256": "41e6aaaff981f6729690f472eb2c7a5d1dda07349077e34444527b9700b0aea5" }, "downloads": -1, "filename": "socketIO-client-nexus-0.7.6.tar.gz", "has_sig": false, "md5_digest": "a0f84df9549e69a329b81e740b82b708", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20128, "upload_time": "2017-10-05T17:54:26", "url": "https://files.pythonhosted.org/packages/ad/ec/5a328019992d77703fd7075e0dec80db01f2a040b831f0a7035ff5ba7fac/socketIO-client-nexus-0.7.6.tar.gz" } ] }