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)
def _set_location(self): self._request.ws_location = build_location(self._request)
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)
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)