You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're working on messaging app .
First - I login, and then I'm setting the realm name ('realm_'+username);
Now what I'm doing is
$wamp.connection._ options.realm = 'realm_'+$cookies.get('key');
$wamp.open();
But I think it's not good in practice, because sometimes, when wamp is closing socket and reconnecting - the behavior of socket becomes unpredictable , so your only solution is to restart the page.
Is there any method to set custom realm after login and not doin "$wamp.connection._options.realm " this thingy ?
Because there's method setAuthId and It'll be useful to have a method setRealm.
The text was updated successfully, but these errors were encountered:
I haven't tested this, but something like this should work:
//create a service that wraps the $wampProvider.provider('myWamp',function(myWampProvider){this.$get=function($rootScope,$q,$log,$cookies){varoptions={url: 'ws://127.0.0.1:8080',realm: $cookies.get('key')};varwp=$wampProvider;wp.init(options);returnwp.$get($rootScope,$q,$log);};})//in you controller.controller('MyController',function(myWamp){myWamp.open();})
I actually agree with @so1337 here. Why is the only setting changeable from the outside the authId? Shouldn't all of autobahn's connection options be prone to change, including the URL?
We're working on messaging app .
First - I login, and then I'm setting the realm name ('realm_'+username);
Now what I'm doing is
$wamp.connection._ options.realm = 'realm_'+$cookies.get('key');
$wamp.open();
But I think it's not good in practice, because sometimes, when wamp is closing socket and reconnecting - the behavior of socket becomes unpredictable , so your only solution is to restart the page.
Is there any method to set custom realm after login and not doin "$wamp.connection._options.realm " this thingy ?
Because there's method setAuthId and It'll be useful to have a method setRealm.
The text was updated successfully, but these errors were encountered: