how to have webpack-dev-server connect to different wss port than the http port?

132 Views Asked by At

I have a react app running on webpack dev server with hot module replacement on http://localhost:3010

the traffic is coming from a browser on the internet, from an nginx reverse proxy listening on https://my.domain.com:443 and forwarding to http://localhost:3010

I want webpack-dev-server to send the WS traffic to wss://my.domain.com:443 but nothing seem to work. I configured:

   devServer: {
      allowedHosts: 'all',
      client: {
        webSocketURL: 'wss://my.domain.com:443/ws',
      },
    },

but the chrome network tab indicates that the client code tries to access to: wss://my.domain.com:3010/ws how to have the client sending the WSS traffic to port 443 ?

0

There are 0 best solutions below