tzssangglass commented on issue #8093:
URL: https://github.com/apache/apisix/issues/8093#issuecomment-1284008794

   I know why you get 502. 
   
   because in my demo, client --> APISIX was `wss` protocol, and APISIX to 
upstream was`wss` protocol too.
   
   in your scenes, you need client --> APISIX use  `wss` protocol, and APISIX 
to upstream use was `ws` protocol.
   
   if I make upstream `listen 1983;`, not `listen 1983 ssl`, I would get 502.
   
   so you can config route like:
   
   ```
   curl --location --request PUT 'http://127.0.0.1:9180/apisix/admin/routes/1' \
   --header 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
   --header 'Content-Type: application/json' \
   --data-raw '{
       "upstream": {
           "scheme": "http",
           "nodes": {
               "127.0.0.1:1983": 1
           },
           "type": "roundrobin"
       },
       "enable_websocket": true,
       "uri": "/websocket_handshake"
   }'
   ```
   
   use `"scheme": "http"` to make APISIX connect upstream without SSL, because 
you say that socket.io only can accept `ws`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to