-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
when i use featureprobe-server-sdk-node, the sdk try to establish websocket with rust server, but establish failed, and continuously report websocket error. i notice the sdk use socketio-client to connect websocket, the corresponding code is
private async connectSocket() {
const url = new URL(this._realtimeUrl);
this._logger?.info('connect socket to ' + this._realtimeUrl + ' ' + url.pathname);
const socket = io(this._realtimeUrl, { transports: ['websocket'], path: url.pathname });
socket.on('connect', () => {
this._logger?.info('connect socketio success');
socket.emit('register', { key: this._serverSdkKey });
});
socket.on('update', () => {
this._logger?.info('socketio recv update event');
(async () => {
await this._toggleSyncer.syncNow()
})()
});
socket.on('connect_error', (error: Error) => {
this._logger?.info(`socketio error ${error.message}`);
})
// this._socket = socket;
}
but the 'connect' event listener nerver be triggered. i pick this code fragment out to reproduce the bug, and the error happened. i also tried go sdk and it can work well, both js sdk and node sdk can't work, i guess there is something wrong between socketio-client and rust server
const client = require("socket.io-client");
const { io } = client;
function main() {
const socket = io("http://localhost:4011/realtime", {
path: "/realtime",
transports: ["websocket"],
});
socket.on("connect", () => {
console.log("connected to AB");
});
socket.on("connect_error", (error) => {
console.log(`socketio error ${error}`);
});
}
main();
Metadata
Metadata
Assignees
Labels
No labels