Ejemplo n.º 1
0
def web_socket_transfer_data(request):
    if hasattr(request, 'ws_location'):
        location = request.ws_location
    else:
        # When hybi protocol is used, pywebsocket does not provide
        # ws_location attribute because servers are not required to send
        # Sec-WebSocket-Location header according to the protocol
        # specification. If ws_location attribute is not available,
        # we use pywebsocket's internal function "build_function"
        # to obtain the identical value.
        location = build_location(request)
    msgutil.send_message(request, location)
Ejemplo n.º 2
0
def web_socket_transfer_data(request):
    if hasattr(request, 'ws_location'):
        location = request.ws_location
    else:
        # When hybi protocol is used, pywebsocket does not provide
        # ws_location attribute because servers are not required to send
        # Sec-WebSocket-Location header according to the protocol
        # specification. If ws_location attribute is not available,
        # we use pywebsocket's internal function "build_function"
        # to obtain the identical value.
        location = build_location(request)
    msgutil.send_message(request, location)
Ejemplo n.º 3
0
 def _set_location(self):
     self._request.ws_location = build_location(self._request)
Ejemplo n.º 4
0
 def _set_location(self):
     # |Host|
     host = self._request.headers_in.get('Host')
     if host is not None:
         self._request.ws_location = build_location(self._request)
Ejemplo n.º 5
0
 def _set_location(self):
     # |Host|
     host = self._request.headers_in.get(common.HOST_HEADER)
     if host is not None:
         self._request.ws_location = build_location(self._request)
Ejemplo n.º 6
0
 def _set_location(self):
     self._request.ws_location = build_location(self._request)
Ejemplo n.º 7
0
 def _set_location(self):
     # |Host|
     host = self._request.headers_in.get(common.HOST_HEADER)
     if host is not None:
         self._request.ws_location = build_location(self._request)
Ejemplo n.º 8
0
 def _set_location(self):
     # |Host|
     host = self._request.headers_in.get('Host')
     if host is not None:
         self._request.ws_location = build_location(self._request)