Configuration
A new field when configuring users allows you to restrict which type of connections are allowed for a specific user.
Consider this configuration:
authorization {
users [
{user: bar password: barpwd, permission: {...}}
]
}
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:
authorization {
users [
]
}
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: