Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADDED] New websocket connection types #161

Merged
merged 1 commit into from
Nov 15, 2021
Merged

Conversation

kozlovic
Copy link
Member

Added a LEAF and MQTT websocket connection types. MQTT + WS is
not yet supported, but adding it in preparation.

The current WEBSOCKET connection type is really for regular clients.
Should probably have been something like CLIENT and CLIENT_WS instead
of STANDARD and WEBSOCKET, but at the time there was no plan/thinking
of adding websocket support to other type of connections.

The need for those 2 new connection types is because the admin may
want to have a "user" in the config that can connect as a leafnode,
either websocket or not, but not use this "user" to connect as
a regular client application. It will make more sense with MQTT:
one may want an user to connect for MQTT application, either WS or
not, but not for a non mqtt client. The new config would look like
this:

["MQTT", "MQTT_WS"]

Whereas previously, it would have to be:

["MQTT", "WEBSOCKET"]

But then this would allow a non MQTT client to connect as long as
the application connects to the websocket port (if opened).

Signed-off-by: Ivan Kozlovic ivan@synadia.com

Added a LEAF and MQTT websocket connection types. MQTT + WS is
not yet supported, but adding it in preparation.

The current WEBSOCKET connection type is really for regular clients.
Should probably have been something like CLIENT and CLIENT_WS instead
of STANDARD and WEBSOCKET, but at the time there was no plan/thinking
of adding websocket support to other type of connections.

The need for those 2 new connection types is because the admin may
want to have a "user" in the config that can connect as a leafnode,
either websocket or not, but not use this "user" to connect as
a regular client application. It will make more sense with MQTT:
one may want an user to connect for MQTT application, either WS or
not, but not for a non mqtt client. The new config would look like
this:

["MQTT", "MQTT_WS"]

Whereas previously, it would have to be:

["MQTT", "WEBSOCKET"]

But then this would allow a non MQTT client to connect as long as
the application connects to the websocket port (if opened).

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
Copy link
Member

@aricart aricart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - created an issue nats-io/nsc#434 for nsc to be able to set these values.

@kozlovic kozlovic merged commit ab1121a into master Nov 15, 2021
@kozlovic kozlovic deleted the add_ws_conn_types branch November 15, 2021 16:46
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants