
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
.. image:: https://travis-ci.com/aio-libs/sockjs.svg?branch=master :target: https://travis-ci.com/aio-libs/sockjs
sockjs
is a SockJS <http://sockjs.org>
_ integration for
aiohttp <https://github.com/aio-libs/aiohttp/>
_. SockJS interface
is implemented as a aiohttp
route. Its possible to create any number
of different sockjs routes, ie /sockjs/*
or
/mycustom-sockjs/*
. You can provide different session implementation
and management for each sockjs route.
Simple aiohttp web server is required::
[server:main] use = egg:gunicorn#main host = 0.0.0.0 port = 8080 worker = aiohttp.worker.GunicornWebWorker
Example of sockjs route::
def main(global_settings, **settings): app = web.Application() app.router.add_route('GET', '/', index) sockjs.add_endpoint(app, prefix='/sockjs', handler=chatSession) web.run_app(app)
Client side code::
hybi-10 <http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10>
_xhr-streaming <https://secure.wikimedia.org/wikipedia/en/wiki/XMLHttpRequest#Cross-domain_requests>
_xhr-polling <https://secure.wikimedia.org/wikipedia/en/wiki/XMLHttpRequest#Cross-domain_requests>
_iframe-xhr-polling <https://developer.mozilla.org/en/DOM/window.postMessage>
_EventSource <http://dev.w3.org/html5/eventsource/>
_ used from an iframe via postMessage <https://developer.mozilla.org/en/DOM/window.postMessage>
_)HtmlFile <http://cometdaily.com/2007/11/18/ie-activexhtmlfile-transport-part-ii/>
_
used from an iframe via postMessage.jsonp-polling <https://secure.wikimedia.org/wikipedia/en/wiki/JSONP>
_Python 3.10.0
gunicorn 19.2.0
You can find several examples
in the sockjs repository at github.
https://github.com/aio-libs/sockjs/tree/master/examples
sockjs is offered under the Apache 2 license.
Added argument cors_config
into function add_endpoint()
to support of CORS settings from aiohttp_cors
.
Added arguments heartbeat_delay
and disconnect_delay
into function add_endpoint()
.
Function add_endpoint()
now returns all registered routes.
Replaced returning instances of error HTTP responses on raising its as exceptions.
Changed name of some routes.
Heartbeat task moved from SessionManager
into Session
.
Methods _acquire
and _release
of Sessions
renamed into
acquire
and release
.
Added processing of ConnectionError
in StreamingTransport
.
Changed arguments of handler function. Now handler function must be defined
like async def handler(manager, session, msg):
Constants:
replaced by Frame
enums with corresponding values.
Constants:
replaced by MsgType
enums with corresponding values.
Constants:
replaced by SessionState
enums with corresponding values.
timeout
from Session.__init__()
and SessionManager.__init__()
.heartbeat
of SessionManager.__init__()
renamed into heartbeat_delay
.Session.registry
renamed into Session.app
.SessionManager.route_url()
.heartbeat_delay
and disconnect_delay
into
Session.__init__()
.disconnect_delay
into SessionManager.__init__()
.Mark SockJSRoute.handler and SockJSRoute.websocket as coroutines. #25
Remove a check for "ORIGIN" header #12
Process FRAME_MESSAGE_BLOB message type #12
sockjs.transports.websocket.WebSocketTransport
sockjs.transports.rawwebsocket.RawWebSocketTransport
sockjs.route
add_endpoint without name bugSessionManager.aquire()
- was removed the unnecessary second argument.cors_headers()
.FAQs
SockJS server implementation for aiohttp.
We found that sockjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.