I think it would be really useful to allow use of the ws object (which I believe is the request.environ['wsgi.websocket'] ws object for a given route? ) outside of route functions.
My idea was to store the value from request.environ['wsgi.websocket'] into a dict in Socket object like:
environment = environ['wsgi.websocket'] self.ws.url_ep_map[path] = environment
I would like to make a PR for this feature but couldn't get it to work. Please see a diff of my attempt and point out anything that could be done to make this work. I tried to make use of @ copy_current_request_context then pass the request into route() - then grab the ws from that, but doesn't work.
I think it would be really useful to allow use of the ws object (which I believe is the
request.environ['wsgi.websocket']
ws object for a given route? ) outside of route functions.My idea was to store the value from
request.environ['wsgi.websocket']
into a dict in Socket object like:environment = environ['wsgi.websocket'] self.ws.url_ep_map[path] = environment
I would like to make a PR for this feature but couldn't get it to work. Please see a diff of my attempt and point out anything that could be done to make this work. I tried to make use of
@ copy_current_request_context
then pass the request intoroute()
- then grab the ws from that, but doesn't work.