We need to call the open method by creating a WebSocket object inorder to make a WebSocket connection. How can we do that?

 Posted by Rajnilari2015 on 9/19/2015 | Category: HTML 5 Interview questions | Views: 391 | Points: 40
Answer:

First of all, there is no "open" method on the WebSocket object. However, when we want to create a WebSocket object for establishing a connection, we basically instantiate the WebSocket object that does the trick.

e.g.

var uri ='ws://echo.websocket.org/';

var webSocket = new WebSocket(uri);


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response