ng-socket-io
ng-socket-io copied to clipboard
add payload to connection event
Is there any option to add a payload to the connection event?
The socket io library seems to enable this:
var socket = io.connect('http://localhost:3000', { query: {token: token} });
yet I don't see a way to do so using this wrapper library, since the connection is being made automatically in the constructor
export class Socket_TEST extends Socket {
constructor() {
super({ url: '<URL>, options: {"rememberUpgrade":true,
"transports":["websocket","polling"],
"secure":true,"rejectUnauthorized":true,
"autoConnect":false
} });
}
init(token){
this.ioSocket.query = {token:token};
}
}
//call socket init and then connect
this.socket.init(