Linux 桌面程序单独设置代理
修改程序启动的 .desktop 文件即可,以 zoom 为例:
.desktop 文件路径:/usr/share/applications/Zoom.desktop(也可能在 ~/.local/share/applications 下)
原配置文件
[Desktop Entry]
Name=Zoom
Comment=Zoom Video Conference
Exec=/usr/bin/zoom %U
Icon=Zoom
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Network;Application;
StartupWMClass=zoom
MimeType=x-scheme-handler/zoommtg;x-scheme-handler/zoomus;x-scheme-handler/tel;x-scheme-handler/callto;x-scheme-handler/zoomphonecall;application/x-zoom
X-KDE-Protocols=zoommtg;zoomus;tel;callto;zoomphonecall;
Name[en_US]=Zoom
在其中的 Exec 一项前添加 env http_proxy=http://127.0.0.1:7890 https_proxy=http://127.0.0.1:7890
修改后的配置文件:
[Desktop Entry]
Name=Zoom
Comment=Zoom Video Conference
Exec=env http_proxy=http://127.0.0.1:7890 https_proxy=http://127.0.0.1:7890 /usr/bin/zoom %U
Icon=Zoom
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Network;Application;
StartupWMClass=zoom
MimeType=x-scheme-handler/zoommtg;x-scheme-handler/zoomus;x-scheme-handler/tel;x-scheme-handler/callto;x-scheme-handler/zoomphonecall;application/x-zoom
X-KDE-Protocols=zoommtg;zoomus;tel;callto;zoomphonecall;
Name[en_US]=Zoom
部分软件虽然设置中没有代理选项,但提供了代理参数,如 Discord,在 Exec 行尾追加 --proxy-server="http://127.0.0.1:7890" 即可

浙公网安备 33010602011771号