Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add payload to connection event #64

Open
Boredude opened this issue May 28, 2018 · 1 comment
Open

add payload to connection event #64

Boredude opened this issue May 28, 2018 · 1 comment

Comments

@Boredude
Copy link

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

@zubinraja
Copy link

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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants