{"record":{"id":"6ef2d54a09bc5dae","repo":"microsoft/playwright","slug":"browser-does-not-support-socks5-proxy-authenticati","errorCode":null,"errorMessage":"Browser does not support socks5 proxy authentication","messagePattern":"Browser does not support socks5 proxy authentication","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/browserContext.ts","lineNumber":828,"sourceCode":"}\n\nexport function normalizeProxySettings(proxy: types.ProxySettings): types.ProxySettings {\n  let { server, bypass } = proxy;\n  let url;\n  try {\n    // new URL('127.0.0.1:8080') throws\n    // new URL('localhost:8080') fails to parse host or protocol\n    // In both of these cases, we need to try re-parse URL with `http://` prefix.\n    url = new URL(server);\n    if (!url.host || !url.protocol)\n      url = new URL('http://' + server);\n  } catch (e) {\n    url = new URL('http://' + server);\n  }\n  if (url.protocol === 'socks4:' && (proxy.username || proxy.password))\n    throw new Error(`Socks4 proxy protocol does not support authentication`);\n  if (url.protocol === 'socks5:' && (proxy.username || proxy.password))\n    throw new Error(`Browser does not support socks5 proxy authentication`);\n  server = url.protocol + '//' + url.host;\n  if (bypass)\n    bypass = bypass.split(',').map(t => t.trim()).join(',');\n  return { ...proxy, server, bypass };\n}\n\nconst paramsThatAllowContextReuse: (keyof channels.BrowserNewContextForReuseParams)[] = [\n  'colorScheme',\n  'forcedColors',\n  'reducedMotion',\n  'contrast',\n  'screen',\n  'userAgent',\n  'viewport',\n  'testIdAttributeName',\n];\n\nconst defaultNewContextParamValues: channels.BrowserNewContextForReuseParams = {","sourceCodeStart":810,"sourceCodeEnd":846,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/browserContext.ts#L810-L846","documentation":"Thrown by normalizeProxySettings() when the proxy.server URL protocol is 'socks5:' and username or password is set. Chromium/Firefox pass-through of SOCKS5 credentials via launch flags is not supported by the browsers, so Playwright refuses the combination instead of dropping the credentials silently.","triggerScenarios":"Launch/newContext with proxy: { server: 'socks5://host:1080', username: 'u', password: 'p' }.","commonSituations":"Trying to authenticate to a SOCKS5 proxy through the browser. Assuming Playwright resolves SOCKS5 auth the way it resolves HTTP proxy auth.","solutions":["Drop username/password from the socks5 proxy config (use it only if the SOCKS5 endpoint requires no auth).","Use an HTTP/HTTPS proxy for authenticated proxying: proxy: { server: 'http://host:8080', username, password }.","Front the authenticated SOCKS5 server with a local unauthenticated relay (ssh -D, gost, etc.) and point Playwright at the local endpoint."],"exampleFix":"// before\nproxy: { server: 'socks5://proxy:1080', username: 'u', password: 'p' }\n// after\nproxy: { server: 'http://proxy:8080', username: 'u', password: 'p' }","handlingStrategy":"validation","validationCode":"function validateProxy(proxy?: { server: string; username?: string; password?: string }) {\n  if (!proxy) return;\n  const proto = new URL(proxy.server).protocol;\n  if (proto === 'socks5:' && (proxy.username || proxy.password))\n    throw new Error('Browsers do not support SOCKS5 auth; use an HTTP proxy or drop credentials');\n}","typeGuard":"function isAuthFreeSocks5(proxy: { server: string; username?: string; password?: string }): boolean {\n  return new URL(proxy.server).protocol !== 'socks5:' || (!proxy.username && !proxy.password);\n}","tryCatchPattern":null,"preventionTips":["Do not assume SOCKS5 auth works like HTTP proxy auth — it does not.","If SOCKS auth is mandatory, tunnel through a local relay and connect Playwright without credentials."],"tags":["proxy","socks","network","validation"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}