我有一个在通过 VSCode WSL 中运行的项目,这个项目中 Github Copilot 总是运行不起来,查看日志显示代理连接错误:FetchError: tunneling socket could not be established
[error] [default] Error sending telemetry FetchError: tunneling socket could not be established, cause=Failed to establish a socket connection to proxies: PROXY ***
at fetch (/root/.vscode-server/extensions/github.copilot-1.257.0/node_modules/@adobe/helix-fetch/src/fetch/index.js:99:11)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at cachingFetch (/root/.vscode-server/extensions/github.copilot-1.257.0/node_modules/@adobe/helix-fetch/src/fetch/index.js:288:16)
at Pge.fetch (/root/.vscode-server/extensions/github.copilot-1.257.0/lib/src/network/helix.ts:94:22) {
type: 'system',
_name: 'FetchError',
code: 'ProxyFailedToEstablishSocketConnection',
errno: undefined,
erroredSysCall: undefined
}
但是一个本地的项目却能正常连接
这个问题困扰了我好久,最终在一个 Github Issue 中找到了解决方法。
https://github.com/orgs/community/discussions/43188#discussioncomment-4611500
原文中说取消勾选 Http: Proxy Strict SSL 并且 Http: Proxy Support 改为 on,不过我本地实验发现,其实只需要 Http: Proxy Support 从默认的 override 改为 on 就可以了。