nats.net icon indicating copy to clipboard operation
nats.net copied to clipboard

Websocket Support

Open ColinSullivan1 opened this issue 4 years ago • 7 comments

Websocket Support

Add an option to allow the NATS client to use the websockets client rather than a standard TCP Client. This will likely involve refactoring and a different read loop.

https://docs.microsoft.com/en-us/dotnet/api/system.net.websockets.clientwebsocket?view=netcore-3.1

See #383

ColinSullivan1 avatar Sep 21 '20 19:09 ColinSullivan1

This would be a nice addition for nat.net due to the TLS quirks discussed in https://github.com/nats-io/nats-server/issues/291

plaisted avatar May 02 '22 21:05 plaisted

This would be a nice addition for nat.net due to the TLS quirks discussed in nats-io/nats-server#291

Couldn't agree more. Websockets would be the perfect solution to fix the TLS quirks and to allow connection to a NATS server in the cloud via the most restrictive firewalls.

Seems this would be a fairly well encapsulated task. TCPConnection class could be enhanced or a WebsocketConnection class could be added with reasonable effort.

wolfman42 avatar May 12 '22 12:05 wolfman42

@scottf What is the LoE for WebSockets support in the .NET client?

tbeets avatar Sep 28 '22 19:09 tbeets

I would like to poke the status on this, It is currently making dealing with TLS some what of a pain due to the aforementioned inability to use a proper TLS reverse proxy. This feature would solve/help alleviate that substantially!

tkeller-moxe avatar May 01 '23 21:05 tkeller-moxe

This issue was closed as completed but I cannot find any code referring to websocket in the code. Can someone please clarify? @scottf Is this supported or "not yet"?

ptrubini avatar Nov 13 '23 16:11 ptrubini

@ptrubini The completed comment was added by github, not me.

scottf avatar Nov 13 '23 18:11 scottf

It looks like new client library (https://github.com/nats-io/nats.net.v2) supports websocket. If you can use .net 6 or newer you can switch to new library.

yasar11732 avatar Jan 28 '24 19:01 yasar11732