Multiple realms

#1

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.

0 Likes

#2

Hi Greg,

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.

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

···

Am 23.11.2014 15:50, schrieb Greg Miller:

--
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.

0 Likes

#3

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" } }
}

``

0 Likes

#4

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)?
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"
}
}|
}

>

--
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>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#5

forgot: here is how you would use the function I linked:

https://github.com/tavendo/AutobahnJS/blob/master/package/test/test_pubsub_eligible.js#L27

0 Likes

#6

What I would like is one client connected to 2 different realms.
Which, from your example above, seems totally ok.

Thanks.

0 Likes