你好,我重新测试了一下,打了一下断点,发现进入WebSocket请求构建时的URL是这样的
明显到这里还是
https
,下面是我的调用代码:
connectServer() {
this._client
.connect()
.then((res) => {
console.log(res);
this._client.joinLobby().then(() => {
this._client
.joinOrCreateRoom('room1')
.then(() => {
console.log('join room successfully');
console.log(this._client.lobbyRoomList);
})
.catch((err) => console.log(err));
});
})
.catch((err) => {
console.log(err);
});
}
但是当我去掉了和lobby相关的代码之后断点调试时的URL就是这样的了
下面是我修改后的代码
connectServer() {
this._client
.connect()
.then((res) => {
console.log(res);
this._client
.joinOrCreateRoom('room1')
.then(() => {
console.log('join room successfully');
})
.catch((err) => console.log(err));
})
.catch((err) => {
console.log(err);
});
}