How does Jitsi Meet Bypass webpack-dev-server Proxy?

For Jitsi Meet local development, certain requests bypass the webpack-dev-server proxy, e.g. to serve a local file instead of taking it from the proxy server.

This topic describes how this process works, and corrections/additions are welcome in replies.

Jitsi Meet is the web/mobile interface to the overall Jitsi infrastructure, and so local deployments require the use of a separate backend development server to access the rest of the infrastructure.

Also, some files within the Jitsi Meet code base are actually served from this separate development server, instead of deploying the local file, e.g. HTML files in the root directory.

The proxy is configured on the devServer option in webpack.config.js as follows:

  • devServer configuration object comes from the getDevServerConfig function; using a function to make the code more readable.
  • devServer is configured with a proxy option.
  • proxy is configured with a bypass option to configure bypassing the proxy based on the return value of the devServerProxyBypass function.
  • Finally, the devServerProxyBypass function works by checking if a given HTTP request is to a specific path, e.g. paths starting with /css/ or /images/, and if it is, then the path to the local file is returned instead of continuing to proxy the request.

So, to bypass the Jitsi Meet webpack-dev-server proxy for requests to specific files or paths, the devServerProxyBypass function is coded to check for requests to that specific file or path, and then returns that path. Otherwise, it returns undefined to continue processing the request with proxy.