nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
15.93k stars 1.41k forks source link

Allow non-secure WebSocket Transport #1529

Closed mrudangit closed 4 years ago

mrudangit commented 4 years ago

Feature Request

Allow non-TLS websocket configuration

Use Case:

in one of the use case i am trying out is publish real time market data to HTML5 apps running under Electron. e.g. volume is 1k msg size per record 1000 records and each record update 4 times per second. WSS will spend considerable time in decrypting

Proposed Change:

Allow flag in webSocket configuration block to bypass TLS

Who Benefits From The Change(s)?

HTML5 Clients e..g Electron Dekstop apps running in secure network intranet where TLS may be optional

Alternative Approaches

mrudangit commented 4 years ago

please Refer

https://github.com/nats-io/nats.ws/issues/29

kozlovic commented 4 years ago

@derekcollison The issue was created under the nats-ws client and asked the user to post it here. The question is are we ok to allow that in the server. You were the one who said that we should force TLS (originally, my websocket implementation was not). So I am returning the question to you: is that ok to allow non TLS for websocket.

derekcollison commented 4 years ago

Let's you and I and Alberto chat about it..

kozlovic commented 4 years ago

@mrudangit We could consider adding that, but help us understand better the issue: did you observe high CPU usage with continuous traffic? Nowadays, the TLS overhead is mainly during connection establishment. Not saying that there is no actual overhead, but not as much as you seem to indicate.

mrudangit commented 4 years ago

@kozlovic yes in past using other messaging systems , in my use case we are trying to to squeeze out as much performance once data arrives on the client . HMTL5 Javascript app e.g. a Market Data Watch Grid View display 1000s of stock symbols each one ticking 5 times a second

TLS can be opt-in feature

yangjuncode commented 4 years ago

vote for this. ws is also easier for testing purpose, manage cert is a tedious work especially in offline intranet. since we can use palin tcp socket without cert, so it should also can use the plain websocket.

mrudangit commented 4 years ago

Thank You @kozlovic