How can we confirm a Websocket connection is successful to the Gateway?
Release : 9.x
Component : API Gateway
cURL can be used locally on the Gateway
curl --include --no-buffer --header "Connection: Upgrade" --header "Upgrade: websocket" --header "Host: localhost:7777" --header "Origin: http://example.com:80" --header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" --header "Sec-WebSocket-Version: 13" http://localhost:7777
where:
- The Origin header is optional when using cURL but should match the originating request if used
- The Host header should match the requested host
- 7777 is the port opened for WebSocket communication
If you attempt to access the WebSocket port over HTTP without the required headers you will receive an HTTP 404 error.
This is to be expected as the Gateway is set to serve a Websocket connection over this port. Without the proper headers, it will attempt to server HTTP/HTTPS traffic.