apify/crawlee · warning

Request without proxy ${localAddress} ${request.headers.host

Error message

Request without proxy ${localAddress} ${request.headers.host}

What it means

The container proxy server's prepareRequestFunction logs (via console.warn) when an incoming request carries no matching upstream proxy for its local address and host; it then falls back to the configured fallbackProxyUrl (or undefined upstreamProxyUrl). Strictly this snippet is a warning, not a throw — it signals requests hitting the proxy that would otherwise go out without a proxy mapping.

Source

Thrown at packages/browser-pool/src/container-proxy-server.ts:29

    const proxyServer = new ProxyChainServer({
        prepareRequestFunction({ request }) {
            const prefix4to6 = '::ffff:';
            const localAddress = request.socket.localAddress!.startsWith(prefix4to6)
                ? request.socket.localAddress!.slice(prefix4to6.length)
                : request.socket.localAddress!;

            const upstreamProxyUrl = ipToProxy.get(localAddress);

            if (upstreamProxyUrl === undefined) {
                if (fallbackProxyUrl) {
                    return {
                        upstreamProxyUrl: fallbackProxyUrl,
                        requestAuthentication: false,
                    };
                }

                console.warn(`Request without proxy ${localAddress} ${request.headers.host}`);
            }

            return {
                upstreamProxyUrl,
                requestAuthentication: false,
            };
        },
        port: 0,
    });

    await proxyServer.listen();

    proxyServer.server.unref();

    return {
        port: proxyServer.port,
        ipToProxy,
        async close(closeConnections: boolean) {

View on GitHub (pinned to dbe57fb09c)

Solutions

  1. Check the console.warn context: identify localAddress and host that lack a proxy mapping
  2. Configure fallbackProxyUrl so unmapped requests still route through a known proxy
  3. Ensure the browser is launched with the correct proxy settings pointing at the container proxy
  4. Verify host headers resolve as expected (IPv6 vs IPv4 localhost mismatches are common)
  5. Inspect container networking/proxy binding setup if warnings repeat for every request

Example fix

// before: requests fall through with no proxy
const pool = new BrowserPool({ ... });

// after: provide a fallback proxy in the proxy server config
const proxyServer = await ContainerProxyServer.start({
  fallbackProxyUrl: 'http://user:pass@proxy.example.com:8000',
});
Defensive patterns

Strategy: fallback

Validate before calling

// before starting the pool, ensure a fallback proxy exists
if (!options.fallbackProxyUrl && !process.env.FALLBACK_PROXY_URL) {
  console.warn('No fallbackProxyUrl configured: unmapped proxy requests will go direct');
}

Type guard

function hasProxyConfig(o: { fallbackProxyUrl?: string }): o is { fallbackProxyUrl: string } & typeof o {
  return typeof o.fallbackProxyUrl === 'string' && o.fallbackProxyUrl.length > 0;
}

Try / catch

// the library only warns; monitor stdout for the warning
proxyServer.on?.('warning', (msg) => {
  if (msg.includes('Request without proxy')) metrics.increment('proxy.unmapped_request');
});

Prevention

When it happens

Trigger: A request arrives at the container proxy whose localAddress/host has no assigned upstream proxy and no fallback is set — e.g. a browser in the pool connecting through the proxy port before proxy assignment, or a request to an unexpected host header.

Common situations: Containerized browser pool where the browser reaches the proxy directly bypassing proxy settings; DNS or localhost resolution mismatch causing host header lookup failure; misconfigured proxyUrl so requests fall through to the no-proxy path; race at browser startup before proxy binding.

Related errors


AI-assisted analysis of apify/crawlee@dbe57fb09c (2026-08-30). Data as JSON: /api/errors/2ad840f3c9c4a3d6. Report an issue: GitHub.