0

I'm trying to access my dev server over the local network. The config looks like this:

devServer: {
    port: 5500,
    host: '0.0.0.0',
    https: {
      key: '../shared/tools/certs/key.pem',
      cert: '../shared/tools/certs/foo.pem',
    },
    proxy: {
      '/api/v1': {
        target: 'http://127.0.0.1:3333',
        secure: 'https://127.0.0.1:3333'),
        changeOrigin: true,
      },
      '/api/v2': {
        target: 'http://127.0.0.1:8000',
        secure: 'https://127.0.0.1:8000',
        changeOrigin: true,
      },
    },
  },

The server works perfectly fine when ommitting 'host' and accessing via localhost:5500; however, when setting host to '0.0.0.0' and accessing via the local network it is slow to load.

There seems to be a websocket connection that is stalled for 60 seconds, and only after it times out does the application load:

GET wss://x.x.x.x:5500/ws HTTP/1.1
Host: x.x.x.x:5500
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
Origin: https://x.x.x.x:5500
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Accept-Encoding: gzip, deflate, br
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8,no;q=0.7
Cookie: _legacy_auth0.hU1PUEfHwuvrxHqPu3lgi0q7cbTMMkke.is.authenticated=true; auth0.hU1PUEfHwuvrxHqPu3lgi0q7cbTMMkke.is.authenticated=true
Sec-GPC: 1
Sec-WebSocket-Key: /cC0fFlD2+w+Vwb2II5kUQ==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

Timing of websocket request

I have tried what was suggested here but it didn't help.

0 Answers0