angular-socket-io
angular-socket-io copied to clipboard
able to change Query for reconnect
just leave a simple access to socket object to able to change query for auto-reconnection
var wrappedSocket = {
on: addListener,
socket:socket, //this line
addListener: addListener,
once: addOnceListener,
...
example of using
this.socket.socket.socket.options.query = '?token='+user_token;
I'm also really interested accessing the query in order to append the auth token in the socket for authentificate the user through JWT.
This may not be the real way to do it, but don't know another for now
Duplicate of #12.
Actually, this is not a strict duplicate.
If you want to be able to access some property of the socket, the right way is to expose it via a getter. I've described how to do this several times before in other issues.
@btford i see you had added a setter for the internal socket in #12 but it has since been removed? I filed a similar issue #86, but simply exposing properties of the socket object on the wrapper aren't really a solution for me, as I need to destroy it and reconnect. Providing direct access to the socket in a public property is really the simplest way to go here, IMO.