parameters: (self, accept)
return_statement: return ''.join(response)
docstring: Override hybi._create_handshake_response.
docstring_summary: Override hybi._create_handshake_response.
docstring_tokens: Override hybi . _create_handshake_response .
function: def _create_handshake_response(self, accept):
          """Override hybi._create_handshake_response."""
  
          response = []
  
          response.append('HTTP/1.1 101 Switching Protocols\r\n')
  
          # Upgrade and Sec-WebSocket-Accept should be excluded.
          response.append('%s: %s\r\n' % (
              common.CONNECTION_HEADER, common.UPGRADE_CONNECTION_TYPE))
          if self._request.ws_protocol is not None:
              response.append('%s: %s\r\n' % (
                  common.SEC_WEBSOCKET_PROTOCOL_HEADER,
                  self._request.ws_protocol))
          if (self._request.ws_extensions is not None and
              len(self._request.ws_extensions) != 0):
              response.append('%s: %s\r\n' % (
                  common.SEC_WEBSOCKET_EXTENSIONS_HEADER,
                  common.format_extensions(self._request.ws_extensions)))
          response.append('\r\n')
  
          return ''.join(response)
function_tokens: def _create_handshake_response ( self , accept ) : response = [ ] response . append ( 'HTTP/1.1 101 Switching Protocols\r\n' ) # Upgrade and Sec-WebSocket-Accept should be excluded. response . append ( '%s: %s\r\n' % ( common . CONNECTION_HEADER , common . UPGRADE_CONNECTION_TYPE ) ) if self . _request . ws_protocol is not None : response . append ( '%s: %s\r\n' % ( common . SEC_WEBSOCKET_PROTOCOL_HEADER , self . _request . ws_protocol ) ) if ( self . _request . ws_extensions is not None and len ( self . _request . ws_extensions ) != 0 ) : response . append ( '%s: %s\r\n' % ( common . SEC_WEBSOCKET_EXTENSIONS_HEADER , common . format_extensions ( self . _request . ws_extensions ) ) ) response . append ( '\r\n' ) return '' . join ( response )