any plans to add websockets support ? #1

Open
opened 2021-10-15 16:09:24 +03:00 by jar3b · 2 comments
jar3b commented 2021-10-15 16:09:24 +03:00 (Migrated from gitlab.connectone.pro)

Created by: gedw99

this is really cool

I found yours by accident after looking at this: https://github.com/ripienaar/nats-roundtripper/blob/main/caddy-middleware/README.md

Basically I am using golang WASM client GUI like here:
https://github.com/gioui/gio-example

and they want to use HTTP and Websockets to talk to a "server".

SO i want to let them talk to the NATS Proxy ( like this one), and because NATS understands HTTP and Websockets, just proxy all the stuff through to a backend golang microservice that supports NATS golang client.

maybe your intend is a bit different ?

*Created by: gedw99* this is really cool I found yours by accident after looking at this: https://github.com/ripienaar/nats-roundtripper/blob/main/caddy-middleware/README.md Basically I am using golang WASM client GUI like here: https://github.com/gioui/gio-example and they want to use HTTP and Websockets to talk to a "server". SO i want to let them talk to the NATS Proxy ( like this one), and because NATS understands HTTP and Websockets, just proxy all the stuff through to a backend golang microservice that supports NATS golang client. maybe your intend is a bit different ?
jar3b commented 2021-10-20 01:08:48 +03:00 (Migrated from gitlab.connectone.pro)

Created by: jar3b

@gedw99, hello! I use this solution in my current work to provide communication scheme like this:

image

My problem is getting access to internal organization resources (in LAN behind NAT) from own cloud. For example: .net SOAP client needs access to resource http://private-org-svc.local located in Local Network 1.

  1. .NET wsdl client is configured to use http://http-nats-proxy:8080 (this is service inside k8s cluster) as default HTTP/HTTPS proxy.
  2. .NET wsdl client sets some HTTP Header identifier which Agent in private LAN need to be used.
  3. .NET wsdl client sends http message to http-nats-proxy, it converts request to NATS request (using this repo) and sends this request to specific Agent (detecting it by HTTP header) in organization network.
  4. Agent 1 (written in .net core) decodes NATS request and converts it to HTTP request then sends to organization resource server.
  5. Resource server returns HTTP response, ..., data backs to .NET wsdl client.

http-nats-proxy is the service uses this repo and https://github.com/rainforestapp/mitm, and performs request-response handling.

So, for my case, I only need an HTTP/HTTPS proxy, maybe (in future) a websocket if I need access to a websocket resource behind NAT in a private network.

To summarize, sorry, - unfortunately, it's unlikely that i will implement support for websockets in near future. Also, the websocket support that I probably need needs to be implemented in a slightly different way: first of all in a mitm proxy and then possibly in the RoundTripper.

*Created by: jar3b* @gedw99, hello! I use this solution in my current work to provide communication scheme like this: ![image](https://user-images.githubusercontent.com/14801796/137994800-84028f2c-96d5-4072-a366-9fdf71688163.png) My problem is getting access to internal organization resources (in LAN behind NAT) from own cloud. For example: `.net SOAP client` needs access to resource `http://private-org-svc.local` located in `Local Network 1`. 1. `.NET wsdl client` is configured to use http://http-nats-proxy:8080 (this is service inside k8s cluster) as default HTTP/HTTPS proxy. 2. `.NET wsdl client` sets some HTTP Header identifier which `Agent` in private LAN need to be used. 3. `.NET wsdl client` sends http message to `http-nats-proxy`, it converts request to NATS request (using this repo) and sends this request to specific `Agent` (detecting it by HTTP header) in organization network. 4. `Agent 1` (written in .net core) decodes NATS request and converts it to HTTP request then sends to organization resource server. 5. Resource server returns HTTP response, ..., data backs to .NET wsdl client. `http-nats-proxy` is the service uses this repo and https://github.com/rainforestapp/mitm, and performs request-response handling. So, for my case, I only need an HTTP/HTTPS proxy, maybe (in future) a websocket if I need access to a websocket resource behind NAT in a private network. To summarize, sorry, - unfortunately, it's unlikely that i will implement support for websockets in near future. Also, the websocket support that I probably need needs to be implemented in a slightly different way: first of all in a mitm proxy and then possibly in the `RoundTripper`.
jar3b commented 2021-10-22 12:07:08 +03:00 (Migrated from gitlab.connectone.pro)

Created by: gedw99

hey @jar3b thanks an awesome rundown - really awesome ...

Maybe i can just use SSE then, since it runs over HTTP, and not bother with websockets. DO you think SSE wil work over your nats-transport ?

SSE works everywhere now :https://caniuse.com/eventsource

The nats.go gets and sets the data into Nats Server.

*Created by: gedw99* hey @jar3b thanks an awesome rundown - really awesome ... Maybe i can just use SSE then, since it runs over HTTP, and not bother with websockets. DO you think SSE wil work over your nats-transport ? SSE works everywhere now :https://caniuse.com/eventsource The nats.go gets and sets the data into Nats Server.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: pub/nats-transport#1
No description provided.