8

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?

Emile Cormier
  • 28,391
  • 15
  • 94
  • 122
Czar Pino
  • 6,258
  • 6
  • 35
  • 60

1 Answers1

5

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.

Bramus
  • 1,732
  • 14
  • 19
oberstet
  • 21,353
  • 10
  • 64
  • 97