[javascript] View Plain Text
Function openChannel() {
Console.log ("Open the channel." );
Socket = new WebSocket (
" ws:// 192. 168. 1. 102:8080/rt CAPP/web socket? u = $ { user }”;
socket.onopen = onChannelOpened
socket . on message = onchannel message;
socket . on close = onChannelClosed;
}
Establish a WebSocket connection, register related events, and then use the events to get the port number.