Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoint support #319

Closed
hrzr opened this issue Dec 8, 2017 · 2 comments
Closed

Endpoint support #319

hrzr opened this issue Dec 8, 2017 · 2 comments

Comments

@hrzr
Copy link

hrzr commented Dec 8, 2017

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

@RemiCardona
Copy link
Collaborator

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.

Hope that helps, cheers.

@aaugustin
Copy link
Member

I think we need this feature, see #311.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants