I've removed the existing WebSocket support as part of #127 with the intention of developing it outside of this package, then later migrating it back in (if it makes sense to do so). My main concern is that I want to avoid impacting the stability of the HTTP implementation which is the primary use-case, and the maintenance burden was too much for the amount of capacity I have to spare currently. I also want to re-design it with broadcast support as an initial requirement rather than a feature added on later.
I think a new project might use Mangum as a dependency, or could end up looking something like this:
from mangum import Mangum
from mangum_ws import MangumWebSocket
def handler(event, context):
if 'eventType' in event['requestContext']:
asgi_handler = MangumWebSocket(app)
else:
asgi_handler = Mangum(app)
return asgi_handler(event, context)
Not really sure. I haven't been motivated to take this up for awhile, but if anyone wants to give it a shot I can help where possible.
I've removed the existing WebSocket support as part of #127 with the intention of developing it outside of this package, then later migrating it back in (if it makes sense to do so). My main concern is that I want to avoid impacting the stability of the HTTP implementation which is the primary use-case, and the maintenance burden was too much for the amount of capacity I have to spare currently. I also want to re-design it with broadcast support as an initial requirement rather than a feature added on later.
I think a new project might use Mangum as a dependency, or could end up looking something like this:
Not really sure. I haven't been motivated to take this up for awhile, but if anyone wants to give it a shot I can help where possible.