Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the AutobahnJS realm for?

Just wondering what the mysterious realm field in AutobahnJS is. From the docs, creating a connection is as follows:

var connection = new autobahn.Connection({
    url: 'ws://127.0.0.1:9000/',
    realm: 'realm1'
});

I don't set a realm server-side so what is this realm parameter for? Furthermore, it is a required field which must mean it is necessary for the connection to work. Can someone enlighten us on this?

like image 831
Czar Pino Avatar asked Jun 02 '14 08:06

Czar Pino


1 Answers

A Realm is a WAMP routing and administrative domain (optionally) protected by authentication and authorization. (see https://wamp-proto.org/_static/gen/wamp_latest.html#realms-sessions-and-transports).

A single WAMP router can manage multiple realms. Hence, the realm is required to establish a session, as the server URL alone is not sufficient to know which realm to attach the session to.

PS: The AutobahnJS docs should talk about this .. needs improvement.

like image 161
oberstet Avatar answered Sep 28 '22 07:09

oberstet