function setupGcsReverseProxy()

in cloudrun-malware-scanner/gcs-proxy-server.ts [102:120]


function setupGcsReverseProxy() {
  const proxy = httpProxy.createProxyServer({
    target: 'https://storage.googleapis.com/',
    changeOrigin: true,
    autoRewrite: true,
    secure: true,
    ws: false,
  });

  proxy.on('proxyReq', handleProxyReq);
  proxy.on('error', handleProxyError);

  const PROXY_PORT = parseInt(process.env.PROXY_PORT || '8888', 10);

  proxy.listen(PROXY_PORT, 'localhost');
  logger.info(
    `GCS authenticating reverse proxy listenting on port ${PROXY_PORT} for requests to ${clamCvdMirrorBucket}`,
  );
}