You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu下VS Code扩展市场连接失败:ERR_PROXY_CONNECTION_FAILED

解决方案

一、解决VS Code代理连接失败(ERR_PROXY_CONNECTION_FAILED)问题

1. 先验证代理服务器可用性

先排除代理本身的问题,在终端执行:

curl -x http://ip:port https://marketplace.visualstudio.com

如果命令返回正常HTML内容,说明代理无问题;若报错,先检查代理IP、端口是否正确,或代理服务器是否允许你的设备访问。

2. 修正VS Code的代理配置

  • 通过GUI设置:
    打开VS Code → 按Ctrl+,打开设置 → 搜索proxy:

    • 确保HTTP: Proxy设为http://ip:port
    • 将Proxy Support设为on或override
    • 检查Proxy Exclude列表,不要包含marketplace.visualstudio.com或*.visualstudio.com
  • 通过JSON配置文件:
    按Ctrl+Shift+P → 输入Open Settings (JSON) → 添加或修改以下配置:

    "http.proxy": "http://ip:port",
    "https.proxy": "http://ip:port",
    "proxySupport": "on",
    "http.proxyStrictSSL": false // 仅当代理使用自签名SSL证书时启用
    

3. 避免系统代理冲突

多来源代理配置可能引发冲突,推荐先统一环境变量再启动VS Code:

export http_proxy=http://ip:port
export https_proxy=http://ip:port
code

4. 检查网络防火墙规则

  • 检查Ubuntu本地防火墙是否限制VS Code联网:
    sudo ufw status
    
    若VS Code被拒绝,添加允许规则:
    sudo ufw allow out to any app "Code - OSS"
    
  • 确认代理服务器端是否未将你的IP加入白名单,或存在端口限制。

二、解决Chrome的libva错误

该错误属于硬件加速驱动问题,与代理无关,可通过以下两种方式解决:

1. 临时禁用GPU加速启动Chrome

google-chrome --proxy-server=http://ip:port --disable-gpu --disable-software-rasterizer

2. 安装对应硬件的VA-API驱动

  • Intel显卡:
    sudo apt update && sudo apt install intel-media-va-driver
    
  • AMD/NVIDIA开源驱动:
    sudo apt update && sudo apt install mesa-va-drivers
    

内容的提问来源于stack exchange,提问作者Mehdi Charife

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 16:50:30