-
Notifications
You must be signed in to change notification settings - Fork 21
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
Deferred Connection #37
Comments
I just added jquery.ajax call before $io.connect inside ember-sockets.js Something like this
Works fine)) I don't know if it's good practice or not. |
I've moved the connection process into a Defer the connection by setting $window.App = Ember.Application.create({
Socket: EmberSockets.extend({
controllers: ['index'],
autoConnect: false
})
}); And then in your controller – such as your this.socket.connect({
query: { token: 123 }
}); Please let me know if this works for you guys! 👍 |
Awesome @Wildhoney. I haven't had a chance to try it yet, but that looks like it will work perfectly. |
I am attempting to do token based authentication using socket.io and I'm interested in using this library.
The issue I'm running into is that I need to receive the token from the server before making the socket.io connection. The current design seems to require that I both instantiate and connect EmberSocket at the same time, and in my case, before I have the token to connect with.
What do you all think about separating the instantiation and the connection? Ideally I could do something like.
Then elsewhere in the authentication flow something like.
The text was updated successfully, but these errors were encountered: