Implement protocol upgrading to websocket