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

(re)configuration after start #1

Open
salkat opened this issue Sep 7, 2018 · 1 comment
Open

(re)configuration after start #1

salkat opened this issue Sep 7, 2018 · 1 comment

Comments

@salkat
Copy link

salkat commented Sep 7, 2018

Sorry for not very smart question
In my program user make authorization and only after this my program knows which server will be used for data exchange
How can I configure socket not in AppModule and not in extended class? I can't find this case in your examples

@seba-salavilla
Copy link

Sorry for not very smart question
In my program user make authorization and only after this my program knows which server will be used for data exchange
How can I configure socket not in AppModule and not in extended class? I can't find this case in your examples

First in SocketIoConfig (app.module) add autoConnect option to false, then in Socketservices class create a method Connect(token) with params as you want.
Now you can reconfigure the connections and options of socket instance.

Example:
this.socket.ioSocket.io.opts.query = { token: 'minuevotoken' }
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