Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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)
Exemplo n.º 5
0
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)
Exemplo n.º 6
0
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)  
Exemplo n.º 8
0
def webSocket():
  if request.environ.get('wsgi.websocket'):
    handle_websocket(request.environ["wsgi.websocket"])
  return
Exemplo n.º 9
0
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)