Configure the Node-side API connection in webpack.config.mjs using the current proxy-array form:

import { HttpsProxyAgent } from 'https-proxy-agent';

export default {
  devServer: {
    proxy: [{
      context: ['/api'],
      target: 'https://service.example',
      changeOrigin: true,
      agent: new HttpsProxyAgent('http://proxy.example:8080'),
      pathRewrite: { '^/api': '' },
    }],
  },
};

The route is:

browser → webpack dev server → corporate proxy → HTTPS API

target remains the real HTTPS API. The agent, assumed already available in the project, negotiates the path through the HTTP intermediary.

context selects browser-facing request paths; pathRewrite removes the development prefix. Neither names the corporate proxy. Retain those mappings for the API's expected path.

Use the middleware's normal streaming and response handling so API rejection and transport failure remain distinguishable. A second handwritten relay that always returns 200 would hide that result.

Browser proxy settings and npm's package-download proxy configure other consumers. This setting belongs to the webpack process making the external API call.

Allakkat attuumassuteqartut