예제 #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)
예제 #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)
예제 #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)
예제 #4
0
파일: __init__.py 프로젝트: cjus/umf_router
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)
예제 #5
0
파일: __init__.py 프로젝트: vgel/plydraw2
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)
예제 #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)  
예제 #8
0
파일: app.py 프로젝트: LiuXiangyu/cast
def webSocket():
  if request.environ.get('wsgi.websocket'):
    handle_websocket(request.environ["wsgi.websocket"])
  return
예제 #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)