{"record":{"id":"5421b4ccbbd58634","repo":"apify/crawlee","slug":"invalid-proxyurl-option-authentication-is-only","errorCode":null,"errorMessage":"Invalid \"proxyUrl\" option: authentication is only supported for HTTP proxy type.","messagePattern":"Invalid \"proxyUrl\" option: authentication is only supported for HTTP proxy type\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser-crawler/src/internals/browser-launcher.ts","lineNumber":339,"sourceCode":"            case 'win32':\n                return getWin32Path();\n            default:\n                return '/usr/bin/google-chrome';\n        }\n    }\n\n    private validateProxyUrlProtocol(proxyUrl?: string): void {\n        if (!proxyUrl) return;\n\n        if (!/^(http|https|socks4|socks5)/i.test(proxyUrl)) {\n            throw new Error(`Invalid \"proxyUrl\". Unsupported protocol: ${proxyUrl}.`);\n        }\n\n        const url = new URL(proxyUrl);\n\n        if (url.username || url.password) {\n            if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n                throw new Error('Invalid \"proxyUrl\" option: authentication is only supported for HTTP proxy type.');\n            }\n        }\n    }\n}\n","sourceCodeStart":321,"sourceCodeEnd":344,"githubUrl":"https://github.com/apify/crawlee/blob/dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c/packages/browser-crawler/src/internals/browser-launcher.ts#L321-L344","documentation":"The second check in `validateProxyUrlProtocol()`: if the `proxyUrl` embeds credentials (`url.username` or `url.password`), the scheme must be `http:` or `https:`. Browsers' proxy settings (and Chromium's `--proxy-server` flag) do not support inline authentication for SOCKS proxies, so a `socks5://user:pass@host:port` value is rejected with this explicit message rather than failing mysteriously at connect time.","triggerScenarios":"Constructing the launcher/crawler with a `proxyUrl` such as `socks5://user:pass@host:1080` — a SOCKS4/SOCKS5 proxy URL that includes username/password in the URL.","commonSituations":"Proxy providers issue SOCKS credentials and developers paste them straight into the URL; migrating a proxy string from an HTTP proxy (where inline auth works) to a SOCKS proxy without removing the credentials; assuming SOCKS5 RFC 1929 auth maps to URL credentials.","solutions":["Switch to an HTTP/HTTPS proxy endpoint from your provider so inline credentials (`http://user:pass@host:port`) work","Remove credentials from the SOCKS URL and authenticate at the network level (IP allowlisting the crawler's IP at the proxy provider)","Handle SOCKS auth out-of-band (e.g. a local forwarder like `gost`/`3proxy` that adds the credentials, then point proxyUrl at it)","Ask the provider for an authenticated HTTP tunnel or an IP-whitelisted SOCKS endpoint"],"exampleFix":"// before\nproxyUrl: 'socks5://user:pass@proxy.example.com:1080' // throws\n// after\nproxyUrl: 'http://user:pass@proxy.example.com:8080' // HTTP proxy with inline auth, supported","handlingStrategy":"validation","validationCode":"function assertProxyAuthSupported(proxyUrl?: string): void {\n    if (!proxyUrl) return;\n    const url = new URL(proxyUrl);\n    if ((url.username || url.password) && !['http:', 'https:'].includes(url.protocol)) {\n        throw new Error(`Inline credentials are only supported for http/https proxies, got ${url.protocol}`);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    const launcher = new BrowserLauncher({ proxyUrl });\n} catch (e) {\n    if (e instanceof Error && /authentication is only supported for HTTP proxy/.test(e.message)) {\n        log.error('Move credentials out of the SOCKS URL: use IP allowlisting or an HTTP proxy endpoint');\n    }\n    throw e;\n}","preventionTips":["Strip user:pass from SOCKS URLs and use provider IP allowlisting instead","Prefer HTTP proxy endpoints when inline credentials are required","Keep a config-level validator that mirrors the launcher's scheme+auth rules before deployment"],"tags":["proxy","validation","authentication","socks"],"backgroundTag":"invalid-proxy-url","analyzedSha":"dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c","analyzedAt":"2026-08-30T22:22:28.328Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}