ng-socket-io icon indicating copy to clipboard operation
ng-socket-io copied to clipboard

add payload to connection event

Open Boredude opened this issue 6 years ago • 1 comments

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

Boredude avatar May 28 '18 11:05 Boredude

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(); this.socket.connect();

zubinraja avatar Feb 16 '21 18:02 zubinraja