{"id":28520625,"url":"https://github.com/aio-libs/sockjs","last_synced_at":"2025-07-02T19:32:44.602Z","repository":{"id":29918671,"uuid":"33464566","full_name":"aio-libs/sockjs","owner":"aio-libs","description":"SockJS Server","archived":false,"fork":false,"pushed_at":"2024-12-25T16:58:06.000Z","size":548,"stargazers_count":118,"open_issues_count":8,"forks_count":40,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-06-09T07:08:36.721Z","etag":null,"topics":["aiohttp","asyncio","sockjs","websockets"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aio-libs.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-04-06T03:14:54.000Z","updated_at":"2024-12-25T16:57:10.000Z","dependencies_parsed_at":"2024-01-30T00:55:33.044Z","dependency_job_id":null,"html_url":"https://github.com/aio-libs/sockjs","commit_stats":{"total_commits":458,"total_committers":32,"mean_commits":14.3125,"dds":0.7336244541484715,"last_synced_commit":"74042149507d967edca42b2f444594df4939ddc0"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/aio-libs/sockjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Fsockjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Fsockjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Fsockjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Fsockjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aio-libs","download_url":"https://codeload.github.com/aio-libs/sockjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Fsockjs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263203417,"owners_count":23430025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiohttp","asyncio","sockjs","websockets"],"created_at":"2025-06-09T07:07:45.527Z","updated_at":"2025-07-02T19:32:44.593Z","avatar_url":"https://github.com/aio-libs.png","language":"Python","readme":"SockJS server based on Asyncio (PEP 3156)\n=========================================\n\n.. image:: https://travis-ci.com/aio-libs/sockjs.svg?branch=master\n    :target: https://travis-ci.com/aio-libs/sockjs\n\n`sockjs` is a `SockJS \u003chttp://sockjs.org\u003e`_ integration for\n`aiohttp \u003chttps://github.com/aio-libs/aiohttp/\u003e`_.  SockJS interface\nis implemented as a `aiohttp` route. Its possible to create any number\nof different sockjs routes, ie `/sockjs/*` or\n`/mycustom-sockjs/*`. You can provide different session implementation\nand management for each sockjs route.\n\nSimple aiohttp web server is required::\n\n   [server:main]\n   use = egg:gunicorn#main\n   host = 0.0.0.0\n   port = 8080\n   worker = aiohttp.worker.GunicornWebWorker\n\n\nExample of sockjs route::\n\n   def main(global_settings, **settings):\n       app = web.Application()\n       app.router.add_route('GET', '/', index)\n       sockjs.add_endpoint(app, prefix='/sockjs', handler=chatSession)\n       web.run_app(app)\n\nClient side code::\n\n  \u003cscript src=\"https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js\"\u003e\u003c/script\u003e\n  \u003cscript\u003e\n    var sock = new SockJS('http://localhost:8080/sockjs');\n\n    sock.onopen = function() {\n      console.log('open');\n      sock.send('test');\n    };\n\n    sock.onmessage = function(e) {\n      console.log('message', e.data);\n      sock.close();\n    };\n\n    sock.onclose = function() {\n      console.log('close');\n    };\n  \u003c/script\u003e\n\nSupported transports\n--------------------\n\n* websocket `hybi-10\n  \u003chttp://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10\u003e`_\n* `xhr-streaming\n  \u003chttps://secure.wikimedia.org/wikipedia/en/wiki/XMLHttpRequest#Cross-domain_requests\u003e`_\n* `xhr-polling\n  \u003chttps://secure.wikimedia.org/wikipedia/en/wiki/XMLHttpRequest#Cross-domain_requests\u003e`_\n* `iframe-xhr-polling\n  \u003chttps://developer.mozilla.org/en/DOM/window.postMessage\u003e`_\n* iframe-eventsource (`EventSource\n  \u003chttp://dev.w3.org/html5/eventsource/\u003e`_ used from an `iframe via\n  postMessage\n  \u003chttps://developer.mozilla.org/en/DOM/window.postMessage\u003e`_)\n* iframe-htmlfile (`HtmlFile\n  \u003chttp://cometdaily.com/2007/11/18/ie-activexhtmlfile-transport-part-ii/\u003e`_\n  used from an *iframe via postMessage*.\n* `jsonp-polling \u003chttps://secure.wikimedia.org/wikipedia/en/wiki/JSONP\u003e`_\n\n\nRequirements\n------------\n\n- Python 3.10.0\n\n- gunicorn 19.2.0\n\n- aiohttp https://github.com/aio-libs/aiohttp\n\n\nExamples\n--------\n\nYou can find several `examples` in the sockjs repository at github.\n\nhttps://github.com/aio-libs/sockjs/tree/master/examples\n\n\nLicense\n-------\n\nsockjs is offered under the Apache 2 license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faio-libs%2Fsockjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faio-libs%2Fsockjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faio-libs%2Fsockjs/lists"}