def webapp(environ, start_response): path = environ["PATH_INFO"] if path == "/websocket": with app.request_context(environ): handle_websocket(environ["wsgi.websocket"], grbl) else: return app(environ, start_response)
def my_app(environ, start_response): path = environ["PATH_INFO"] if path == "/": return app(environ, start_response) elif path == "/websocket": handle_websocket(environ["wsgi.websocket"]) else: return app(environ, start_response)
def my_app(environ, start_response): path = environ["PATH_INFO"] if path == "/data": handle_websocket( environ["wsgi.websocket"], parse_qs(environ['QUERY_STRING']).get('group', [''])[0]) else: return app(environ, start_response)
def websocket_handler(environ, start_response): path = environ["PATH_INFO"] if path == "/": return app(environ, start_response) elif path == "/ws": handle_websocket(environ["wsgi.websocket"]) else: return app(environ, start_response)
def pydraw(env, start_response): path = env["PATH_INFO"] if path == "/": return app(env, start_response) elif path == "/websocket": handle_websocket(env["wsgi.websocket"]) else: return app(env, start_response)
def my_app(environ, start_response): """This is basically an implementation as recommended at http://socketubs.net/2012/10/28/Websocket_with_flask_and_gevent/ """ path = environ["PATH_INFO"] if path == "/": return app(environ, start_response) elif path == "/websocket": handle_websocket(environ["wsgi.websocket"]) else: return app(environ, start_response)
def my_app(environ, start_response): path = environ["PATH_INFO"] if path == "/": return app(environ, start_response) elif path == "/websocket": handle_websocket(environ["wsgi.websocket"]) elif path =='/shutdown': #handle shutdown request if stopperEvent: stopperEvent.set() #activates the event return app(environ, start_response) else: return app(environ, start_response)
def webSocket(): if request.environ.get('wsgi.websocket'): handle_websocket(request.environ["wsgi.websocket"]) return
def my_app(environ, start_response): path = environ["PATH_INFO"] if path == "/data": handle_websocket(environ["wsgi.websocket"], parse_qs(environ['QUERY_STRING']).get('group',[''])[0]) else: return app(environ, start_response)