implemented websocket handshake