Current location - Quotes Website - Collection of slogans - How to get the websockert port number
How to get the websockert port number
First, establish a connection for the client to get the status in real time. In the case of GAE, it is implemented by GAE channel API, and I use WebSocket here. The code is:

[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.