VS code 代理设置
February 3, 2026·
·
1 min read
Hengkai YAO
Credit or context (Markdown supported)配置代码
{
"workbench.colorTheme": "Monokai Pro",
"workbench.startupEditor": "none",
"git.enableSmartCommit": true,
"security.workspace.trust.untrustedFiles": "open",
"explorer.confirmDragAndDrop": false,
"http.proxy": "http://127.0.0.1:10808",
"http.proxySupport": "on",
"terminal.integrated.env.osx": {
"http_proxy": "http://127.0.0.1:10808",
"https_proxy": "http://127.0.0.1:10808",
"all_proxy": "http://127.0.0.1:10808"
}
}
可以用 VS Code 自带的代理设置。你只需要确认 v2ray 在本机开的代理端口(常见是 SOCKS5 127.0.0.1 (line 1080) 或 HTTP 127.0.0.1 (line 10809))。
推荐做法(VS Code 内置设置)
- 打开设置(
Cmd + ,),搜索 proxy - 设置:
http.proxy:- 如果是 SOCKS5:
socks5://127.0.0.1:1080 - 如果是 HTTP:
http://127.0.0.1:10809
- 如果是 SOCKS5:
http.proxySupport:on(或override)
- 重新加载窗口(
Cmd + Shift + P→Developer: Reload Window)
直接编辑 settings.json(等价)
{
"http.proxy": "socks5://127.0.0.1:1080",
"http.proxySupport": "on"
}
如果你还想让 VS Code 终端/插件也走代理
在 settings.json 里加环境变量(替换为你的端口):
{
"terminal.integrated.env.osx": {
"http_proxy": "socks5://127.0.0.1:1080",
"https_proxy": "socks5://127.0.0.1:1080",
"all_proxy": "socks5://127.0.0.1:1080"
}
}

Authors
Hengkai YAO
(he/him)
Ocean Scientist
Dr. Hengkai Yao (姚恒恺) is a lecturer of School of Mathmetica and Physics at the Qingdao University of Science and Technology. He got Ph.D of Physical Oceanograpy from Ocean University of China. His research interests include mesoscale eddies, ocean modeling and AI oceanography. He is member of the AI Oceanography group, which develops big data in ocean, ocean simulation, and ocean prediction. He is also a chief scientist in Qingdao Oakfull Water Technology Co., Ltd.
