Before messages can be exchanged, a websocket stream first needs to be connected, and then to have the websocket handshake performed. The stream delegates the task of establishing the connection to the next layers. For example, if the next layer is a connectible stream or socket object, it can be accessed to call the necessary function for connecting. Here we make an outbound connection as a client would do.
Before messages can be exchanged, a websocket stream first needs to be connected, and then to have the websocket handshake performed. The stream delegates the task of establishing the connection to the next layers. For example, if the next layer is a connectible stream or socket object, it can be accessed to call the necessary function for connecting. Here we make an outbound connection as a client would do.