Socket.io for NodeJS doesn\'t seem to work as a websocket server
For some reason, socket.io ALWAYS fallback to the long polling and if I force the w
It worked for me!
restUrl = 'http://x.x.x.x:5555;
socket = io(this.restUrl, {
transports: ["websocket"],
upgrade: true,
upgradeTimeout: 6000000,
pingTimeout: 15000000000,
pingInterval: 1500000000,
maxHttpBufferSize: 10000000,
});
connect() {
if (this.socket.connected == false) {
var temp = this;
this.socket.connect();
this.socket.on('event', function (data) {
temp.socketData.next(data);
});
}
}