Update  code style added comments.

Added protocol to WebSocket API.