You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/10/25 21:00:52 UTC

[GitHub] [apisix] Msiavashi opened a new issue, #8175: Websocket proxy returns 502 (Bad Gateway)

Msiavashi opened a new issue, #8175:
URL: https://github.com/apache/apisix/issues/8175

   ### Description
   
   I'm running a sample echo websocket server on my localhost. I added a websocket enabled route ("/")  from dashboard with the rest of the configs as default. Then sat the upstream's Host to my "localhost" and port to "8080" (my web socket port) and leave the rest as default.
   
   I access the websocket server directly using `wscat` and it works fine. However, when I try to access it using APISIX on address `ws://localhost:9080/` it returns 502 bad gateway.
   
   BTW I'm running the echo websocket server as a Docker container connected to the apisix network.
   
   Here is the route:
   
   ```json
   
   {
     "uri": "/",
     "name": "websocket test",
     "methods": [
       "GET",
       "POST",
       "PUT",
       "DELETE",
       "PATCH",
       "HEAD",
       "OPTIONS",
       "CONNECT",
       "TRACE"
     ],
     "upstream": {
       "nodes": [
         {
           "host": "127.0.0.1",
           "port": 8080,
           "weight": 1
         }
       ],
       "timeout": {
         "connect": 6,
         "send": 6,
         "read": 6
       },
       "type": "roundrobin",
       "scheme": "http",
       "pass_host": "pass",
       "keepalive_pool": {
         "idle_timeout": 60,
         "requests": 1000,
         "size": 320
       }
     },
     "enable_websocket": true,
     "status": 1
   }
   
   ```
   
   
   ### Environment
   
   APISIX version: 2.99.0 Docker
   Operating system: Ubuntu 20.04


-- 
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: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tokers commented on issue #8175: Websocket proxy returns 502 (Bad Gateway)

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #8175:
URL: https://github.com/apache/apisix/issues/8175#issuecomment-1291283220

   > BTW I'm running the echo websocket server as a Docker container connected to the apisix network.
   
   So apisix and your websocket server are in different containers?
   
   In such a case, apisix cannot access the websocket server through 127.0.0.1. Try websocket container's IP.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] Msiavashi closed issue #8175: Websocket proxy returns 502 (Bad Gateway)

Posted by GitBox <gi...@apache.org>.
Msiavashi closed issue #8175: Websocket proxy returns 502 (Bad Gateway)
URL: https://github.com/apache/apisix/issues/8175


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org