{ "info": { "author": "Corbin Simpson", "author_email": "simpsoco@osuosl.org", "bugtrack_url": null, "classifiers": [], "description": "============\ntxWS Upgrade\n============\n\ntxWS-Upgrade (pronounced \"Twisted WebSockets Upgrade\") is a small, short, simple library for\nadding WebSockets server support to your favorite Twisted applications.\n\nThis is forked from txWS to add upgrade support.\nhttps://github.com/MostAwesomeDude/txWS\n\n\nUsage\n=====\n\nUse ``txws.WebSocketFactory`` to wrap your factories. That's it! Adding\nWebSockets support has never been easier.\n\n >>> from txws import WebSocketFactory\n >>> reactor.listenTCP(8080, WebSocketFactory(factory_to_wrap))\n\nThere is no extra trick to txWS. There is no special setup involved.\n\nDo you want secure WebSockets? Use ``listenSSL()`` instead of ``listenTCP()``.\n\nUpgrade Usage\n=============\n\nIf you want to use the websocket with in an existing site, Update your code as follows.\n\nThis is a vanilla Twisted website. ::\n\n\n from twisted.web import server\n from twisted.web.resource import Resource\n from twisted.internet import reactor, endpoints\n\n class Simple(Resource):\n isLeaf = True\n def getChild(self, name, request):\n if name == '':\n return self\n return Resource.getChild(self, name, request)\n\n def render_GET(self, request):\n return \"Hello, world! I am located at %r.\" % (request.prepath,)\n\n rootResource = Simple()\n site = server.Site(rootResource)\n\n endpoint = endpoints.TCP4ServerEndpoint(reactor, 8080)\n endpoint.listen(site)\n reactor.run()\n\n\n\nNow add the website has support for WebSockets, to include\n the ``txws.WebSocketUpgradeResource`` and ``txws.WebSocketUpgradeHTTPChannel``. ::\n\n from twisted.web import server\n from twisted.web.resource import Resource\n from twisted.internet import reactor, endpoints\n\n class Simple(Resource):\n isLeaf = True\n def getChild(self, name, request):\n if name == '':\n return self\n return Resource.getChild(self, name, request)\n\n def render_GET(self, request):\n return \"Hello, world! I am located at %r.\" % (request.prepath,)\n\n rootResource = Simple()\n site = server.Site(rootResource)\n\n # 1) Add the imports\n # Create the WebSocketFactory\n # Create the WebSocketUpgradeResource\n # Put the resource into the resource tree\n from txws import WebSocketFactory, WebSocketUpgradeResource\n rootResource.putChild(b\"websocket\",\n WebSocketUpgradeResource(WebSocketFactory(factory_to_wrap)))\n\n\n # 2) Add the imports\n # Replace protocol for the website with the Websocket upgradable ones\n from txws import WebSocketUpgradeHTTPChannel\n site.protocol = VortexWebsocketHTTPChannel\n\n endpoint = endpoints.TCP4ServerEndpoint(reactor, 8080)\n endpoint.listen(site)\n reactor.run()\n\n\nVersions\n========\n\ntxWS supports the following versions of the WebSockets draft:\n\n * Version 76\n\n * Hixie-76 (Chrome 6, Fx 4, Opera 11, **UNTESTED** Safari 5)\n * HyBi-00\n\n * Version 7\n\n * HyBi-07 (Fx 6)\n\n * Version 8\n\n * HyBi-08\n * HyBi-10 (Chrome 14, Chrome 15, Fx 7, Fx 8)\n\n * Version 13\n\n * RFC 6455 (Chrome 16)\n\nAll listed browser versions have been tested and verified working; any browser\nmarked \"UNTESTED\" hasn't been personally tested, but has been reported working\nby third parties.\n\nIn case you're wondering, the version numbers above are correct; WebSockets\nversioning is not sane.\n\nBrowser Quirks\n==============\n\nThis might save you some time when developing your WebSockets-based\napplication.\n\n * Firefox (all versions): WebSockets do not follow the standard WebSocket\n API.\n * Opera 11: WebSockets are disabled by default and are very slow to close\n connections.\n\nComparisons\n===========\n\nHere's how txWS compares to other Twisted WebSockets libraries.\n\ntxWebSockets\n------------\n\ntxWS, unlike txWebSockets, doesn't reuse any HTTP machinery and doesn't\npretend to be HTTP. Whether this is a good or bad thing depends largely on\nwhether the WebSockets standard ends up being a valid HTTP subset.\n\ntxWS supports newer WS versions 7 and 8, but txWebSockets supports the older\nversion 75. Both libraries support version 76.\n\nAutobahn\n--------\n\nAutobahn provides a client library for WebSockets as well as a server, and\nprovides a fancy set of messaging protocols on top of the WS layer. Autobahn\nalso provides support for WS version 10.\n\nHowever, Autobahn doesn't provide support for WS version 76, and requires\nclients to subclass their factories and protocols in order to provide WS\nfunctionality. txWS uses a compositional approach with wrapped protocols,\nallowing completely transparent reuse of existing protocols and factories.\n\nCyclone\n-------\n\nCyclone provides a simple WebSockets handler. This handler can do WS versions\n75 and 76. The Cyclone WebSockets handler is very limited, can only wrap other\nCyclone handlers, and doesn't support any of the more modern WebSockets\nversions.\n\nLicense\n=======\n\ntxWS is (c) 2011 Oregon State University Open Source Lab, (c) 2014 Google\nInc., and is made available under the Apache 2.0 license.\n\nThanks\n======\n\nThank you to all of the contributors in the community who have chipped in to\nhelp keep txWS alive.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/MostAwesomeDude/txWS", "keywords": "", "license": "MIT/X11", "maintainer": "", "maintainer_email": "", "name": "txWS-Upgrade", "package_url": "https://pypi.org/project/txWS-Upgrade/", "platform": "", "project_url": "https://pypi.org/project/txWS-Upgrade/", "project_urls": { "Homepage": "http://github.com/MostAwesomeDude/txWS" }, "release_url": "https://pypi.org/project/txWS-Upgrade/0.10.0/", "requires_dist": null, "requires_python": "", "summary": "Twisted WebSockets wrapper", "version": "0.10.0" }, "last_serial": 5592140, "releases": { "0.10.0": [ { "comment_text": "", "digests": { "md5": "c8f64d6053ce84531263d1a552cc89e9", "sha256": "24e43e2b52c567404b0a34c677ad6e1b58e5da430b4e2ae6ca1ad32e33db0d6d" }, "downloads": -1, "filename": "txWS-Upgrade-0.10.0.tar.gz", "has_sig": false, "md5_digest": "c8f64d6053ce84531263d1a552cc89e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15291, "upload_time": "2019-07-27T07:10:56", "url": "https://files.pythonhosted.org/packages/e0/87/1bc18e99165f8b6360bf80cddfc4a4ca231045ec660da6c3e6dc8f80eeb9/txWS-Upgrade-0.10.0.tar.gz" } ], "0.9.1.post4": [ { "comment_text": "", "digests": { "md5": "717b2be16da38ce257e68849eb5cdafd", "sha256": "4f621fd9a7f0f0b0df3264b3d5e44d380a76356339644ec7e50037e6136f051d" }, "downloads": -1, "filename": "txWS-Upgrade-0.9.1.post4.tar.gz", "has_sig": false, "md5_digest": "717b2be16da38ce257e68849eb5cdafd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15258, "upload_time": "2019-07-27T07:00:40", "url": "https://files.pythonhosted.org/packages/67/57/fc6996ef5706ed9956ee56a570add263af36d7cd5bcad7751e09ef2f68c5/txWS-Upgrade-0.9.1.post4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c8f64d6053ce84531263d1a552cc89e9", "sha256": "24e43e2b52c567404b0a34c677ad6e1b58e5da430b4e2ae6ca1ad32e33db0d6d" }, "downloads": -1, "filename": "txWS-Upgrade-0.10.0.tar.gz", "has_sig": false, "md5_digest": "c8f64d6053ce84531263d1a552cc89e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15291, "upload_time": "2019-07-27T07:10:56", "url": "https://files.pythonhosted.org/packages/e0/87/1bc18e99165f8b6360bf80cddfc4a4ca231045ec660da6c3e6dc8f80eeb9/txWS-Upgrade-0.10.0.tar.gz" } ] }