You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, there is no technical reason why route services should not be able to handle web socket requests. I've tested this by commenting out the above check and attaching a route service to a web socket app. The handshake and traffic work just fine through the route service.
So long as the route service behaves correctly as a reverse proxy and forwards the Connection: Upgrade and Upgrade: Websocket headers to the destination app, there is no reason to block it at gorouter. After all, web socket requests are just HTTP requests.
This issue has been brought up by one of our customers who need a route service to rate-limit their app and have been complaining that it didn't work with web socket apps.
Note: The check is very old. It might be outdated. We recently removed the RequestHandler and let Go do all the work for web sockets. My suspicion is that the check was added because RequestHandler didn't play well together with route services.
Acceptance criteria
Scenario: My web socket app needs rate limiting via a route service. Given
Proposed Change
As a developer
I want to attach a route service to my web socket app
So that I can rate-limit it using the route service
We currently prevent web socket upgrades on routes that have a route service attached.
The check is implemented here
However, there is no technical reason why route services should not be able to handle web socket requests. I've tested this by commenting out the above check and attaching a route service to a web socket app. The handshake and traffic work just fine through the route service.
So long as the route service behaves correctly as a reverse proxy and forwards the
Connection: Upgrade
andUpgrade: Websocket
headers to the destination app, there is no reason to block it at gorouter. After all, web socket requests are just HTTP requests.This issue has been brought up by one of our customers who need a route service to rate-limit their app and have been complaining that it didn't work with web socket apps.
Note: The check is very old. It might be outdated. We recently removed the RequestHandler and let Go do all the work for web sockets. My suspicion is that the check was added because RequestHandler didn't play well together with route services.
Acceptance criteria
Scenario: My web socket app needs rate limiting via a route service.
Given
When I connect to wss://my-websocket-app.bosh-lite.com using a web socket client
Then The connection will work through the route service as expected
Related links
The text was updated successfully, but these errors were encountered: