You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a native for websockets library way to bind different websocket handlers to different endpoints on the same server? Example for clarity:
ws://hostname:8765/endpoint1/ - activates handler1
ws://hostname:8765/endpoint2/ - activates handler2
The text was updated successfully, but these errors were encountered:
It is up to you to implement routing should you want to use this technique, as nothing is available for this purpose is websockets.
With a quick glance, it looks possible to reuse an existing router system, e.g. that from aiohttp. https://aiohttp.readthedocs.io/en/stable/web_reference.html#aiohttp.web.UrlDispatcher. All the logic to add routes is there and looks pretty simple, the main bit left to code would be to create a Request instance and feed it to the dispatcher's resolve method.
I'm sure you could reuse flask's router system too.
Is there a native for websockets library way to bind different websocket handlers to different endpoints on the same server? Example for clarity:
ws://hostname:8765/endpoint1/ - activates handler1
ws://hostname:8765/endpoint2/ - activates handler2
The text was updated successfully, but these errors were encountered: