heroku-python / flask-sockets

[DEPRECATED] Alternative: https://github.com/miguelgrinberg/flask-sock
MIT License
1.74k stars 164 forks source link

Use Flask routing to allow for variables in URL #14

Closed clarkduvall closed 10 years ago

clarkduvall commented 10 years ago

This allows for variable URLs with no change to the current API.

@sockets.route('<name>/receive'):
def receive(ws, name):
    ...

I saw that there was already a pull request for this here: https://github.com/kennethreitz/flask-sockets/pull/7, but I think the solution proposed in this PR is cleaner, with no breaking changes. Based on the other pull request, it looks like a lot of people want this feature.

@kennethreitz what do you think?

ssfrr commented 10 years ago

This is great, thanks @clarkduvall!

I'm using your fork until this gets merged upstream.

kennethreitz commented 10 years ago

Going to go with #18

clarkduvall commented 10 years ago

Works for me, thanks @kennethreitz!