Multiple realms

99 views
Skip to first unread message

Greg Miller

unread,
Nov 23, 2014, 9:50:09 AM11/23/14
to autob...@googlegroups.com
Is there any reason we can't/shouldn't connection to more than one realm from the same client?  I realize I'd need to manage more than one session variable, but that's fine. I just want to make sure it's not going to cause any issues.

Tobias Oberstein

unread,
Nov 23, 2014, 2:40:26 PM11/23/14
to autob...@googlegroups.com
Hi Greg,
You can have a single client open multiple transports to a given router
(or different routers) and on each transport run a WAMP session. No
problem at all.

You cannot run multiple WAMP sessions over a single transport connection
concurrently.

Multiple WAMP sessions would need to be multiplexed (at the WAMP level)
over a single transport - this is not specified and won't be. I was once
contemplating about it, but decided against for the following reason.

Multiplexing should (and can) be done at the transport level. Means: we
might create a WAMP transport that is able to multiplex multiple logical
WAMP transports across a single physical transport (e.g. an underlying
TCP or WebSocket connection). This isn't specified also, but we might
create a spec for this.

Cheers,
/Tobias

>
> --
> You received this message because you are subscribed to the Google
> Groups "Autobahn" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to autobahnws+...@googlegroups.com
> <mailto:autobahnws+...@googlegroups.com>.
> To post to this group, send email to autob...@googlegroups.com
> <mailto:autob...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/autobahnws/296b7fc1-1545-47ee-b869-6eb3744a3dd1%40googlegroups.com
> <https://groups.google.com/d/msgid/autobahnws/296b7fc1-1545-47ee-b869-6eb3744a3dd1%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Greg Miller

unread,
Nov 23, 2014, 2:57:56 PM11/23/14
to autob...@googlegroups.com
So something like this (ws & ws1)?
Where realm1 would be connected on ws, and realm2 on ws1?





"paths"
: {
 
"/": {
   
"type": "static",
   
"directory": "../web"
 
},
 
"ws": {
   
"type": "websocket",
   
"auth": {
   
"wampcra": {
     
"type": "dynamic",
     
"authenticator": "auth.cra.login"
   
}
 
},
 
"ws1": {
   
"type": "websocket",
   
"auth": {
   
"wampcra": {
     
"type": "dynamic",
     
"authenticator": "auth.cra.login"
   
}
 
}
                   
}
     



Tobias Oberstein

unread,
Nov 23, 2014, 3:12:36 PM11/23/14
to autob...@googlegroups.com
What you do below is _also_ possible, but I thought you want to have 2
WAMP sessions to the same router and same realm.

You can have e.g. AutobahnJS

var connection_config = {
url: 'ws://127.0.0.1:8080/ws',
realm: 'realm1'
}

var connection1 = new autobahn.Connection(config);

connection1.onopen = function (session1) {
}

var connection2 = new autobahn.Connection(config);

connection2.onopen = function (session2) {
}

E.g. here

https://github.com/tavendo/AutobahnJS/blob/master/package/test/testutil.js#L37

is a function that will open N WAMP connection and return a promise that
when resolves will provide you N WAMP sessions.


Am 23.11.2014 20:57, schrieb Greg Miller:
> |
> |
> Sosomething like this(ws &ws1)?
> --
> You received this message because you are subscribed to the Google
> Groups "Autobahn" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to autobahnws+...@googlegroups.com
> <mailto:autobahnws+...@googlegroups.com>.
> To post to this group, send email to autob...@googlegroups.com
> <mailto:autob...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/autobahnws/a99dfd1f-2ba4-4410-ae67-021b6266a71f%40googlegroups.com
> <https://groups.google.com/d/msgid/autobahnws/a99dfd1f-2ba4-4410-ae67-021b6266a71f%40googlegroups.com?utm_medium=email&utm_source=footer>.

Tobias Oberstein

unread,
Nov 23, 2014, 3:13:43 PM11/23/14
to autob...@googlegroups.com

Greg Miller

unread,
Nov 23, 2014, 3:20:33 PM11/23/14
to autob...@googlegroups.com
What I would like is one client connected to 2 different realms.
Which, from your example above, seems totally ok.

Thanks.
Reply all
Reply to author
Forward
0 new messages