Configuration

A new field when configuring users allows you to restrict which type of connections are allowed for a specific user.

Consider this configuration:

  1. authorization {
  2. users [
  3. {user: bar password: barpwd, permission: {...}}
  4. ]
  5. }

The option allowed_connection_types (also can be named connection_types or clients) as you can see is a list, and you can allow several types of clients. Suppose you want the user bar to accept both standard NATS clients and WebSocket clients, you would configure the user like this:

  1. authorization {
  2. users [
  3. ]
  4. }

The absence of allowed_connection_types means that all types of connections are allowed (the default behavior).

  • STANDARD
  • WEBSOCKET
  • LEAFNODE
  • MQTT

You can configure remote Leaf node connections so that they connect to the Websocket port instead of the Leaf node port. See Leafnode section.

When running on Docker, WebSocket is not enabled by default, so you’ll have to create a configuration file with the minimal entries, such as: