0

是否可以在上游配置带有 websocket 的领事代理边车?我尝试了以下配置,但它不起作用:

{
  "bind_addr": "172.17.0.2",
  "data_dir": "/consul/data",
  "datacenter": "dc1",
  "node_id" : "98dc3bf4-a364-46d9-8b72-624963064ab2",
  "node_name": "socket-client-agent",
  "leave_on_terminate": true,
  "ports": [
    {
      "grpc": 8502
    }
   ],
  "server": false,
  "service": [
  {
   "address": "172.17.0.3",
   "connect": [
     {
       "sidecar_service": [
         {
           "checks": [
             {
               "interval": "10s",
               "name": "socket-client-sidecar-proxy",
               "tcp": "172.17.0.3:21000"
             }
           ],
          "port": 21000,
          "proxy": [
            {
              "config": [
                {
                  "bind_address": "0.0.0.0",
                  "bind_port": 21000,
                  "protocol": "tcp"
                }
              ],
              "upstreams": [
                {
                  "destination_name": "sockets-server",
                  "local_bind_port": 5001,
                  "config": {
                    "protocol": "tcp"
                  }
                }
              ]
            }
          ]
        }
      ]
    }
   ],
   "id": "socket-client-0",
   "name": "socket-client",
   "port": 5000
   }
   ],
   "ui_config": [
   {
     "enabled": false
   }
  ]
}

从配置中,我尝试连接到使用 websockets 协议的sockets-server服务。我使用特使作为边车代理。

4

1 回答 1

0

目前 Consul 没有正确配置 Envoy 以支持 WebSocket 升级。这个 GitHub 问题有更多关于这个问题的详细信息,以及潜在的修复 - https://github.com/hashicorp/consul/issues/9473

于 2021-01-05T16:30:14.793 回答