跳转至

学术资源加速

当自然情况下无法访问部分学术 / 海外资源时,可以通过以下代理配置进行加速。


特殊海外加速(需要配置)

临时使用配置(推荐,仅当前会话生效)

适合临时测试 / 临时使用,只在当前终端会话里有效,关闭终端或新开一个终端后即失效。
不会改动系统全局环境变量,风险较小,建议优先使用本方式。

Linux 系统(当前终端)

export http_proxy=http://175.168.99.91:789
export https_proxy=http://175.168.99.91:789

去除当前终端中的临时配置:

unset http_proxy
unset https_proxy

Windows 系统(PowerShell,当前终端)

$env:http_proxy = "http://175.168.99.91:789"
$env:https_proxy = "http://175.168.99.91:789"

去除当前终端中的临时配置:

Remove-Item Env:\http_proxy
Remove-Item Env:\https_proxy

Windows 系统(cmd,当前终端)

set http_proxy=http://175.168.99.91:789
set https_proxy=http://175.168.99.91:789

去除当前终端中的临时配置:

set http_proxy=
set https_proxy=

只对单条命令生效(示例)

curl -x http://175.168.99.91:789 https://www.google.com -I

全局生效配置(慎用,会对所有终端生效)

此方式会修改用户级 / 系统级环境变量关闭终端、重启后依然有效
在少部分网站、服务上可能出现异常或报错,请确认有需要再使用,并记住如何恢复

关闭你设置的终端,重新进入终端后仍然会使用代理配置。

Linux 系统

所有用户(修改 /etc/profile

添加全局加速(所有用户):

LINE='export http_proxy=http://175.168.99.91:789
export https_proxy=http://175.168.99.91:789'
FILE='/etc/profile'
grep -qxF "$LINE" "$FILE" || echo "$LINE" >> "$FILE"

去除全局生效的加速(所有用户):

sed -i '/export http_proxy=http:\/\/175\.168\.99\.91:789/,/export https_proxy=http:\/\/175\.168\.99\.91:789/d' /etc/profile
source /etc/profile

当前用户(修改 ~/.bashrc

添加当前用户的全局加速:

LINE='export http_proxy=http://175.168.99.91:789
export https_proxy=http://175.168.99.91:789'
FILE='~/.bashrc'
grep -qxF "$LINE" "$FILE" || echo "$LINE" >> "$FILE"

去除当前用户的全局加速:

sed -i '/export http_proxy=http:\/\/175\.168\.99\.91:789/,/export https_proxy=http:\/\/175\.168\.99\.91:789/d' ~/.bashrc
source ~/.bashrc

Windows 系统(PowerShell,全局环境变量)

添加全局加速(用户级)

[Environment]::SetEnvironmentVariable("http_proxy", "http://175.168.99.91:789", "User")
[Environment]::SetEnvironmentVariable("https_proxy", "http://175.168.99.91:789", "User")

去除全局加速(用户级 + 系统级)

# 删除用户级别的永久变量
[Environment]::SetEnvironmentVariable("http_proxy", $null, "User")
[Environment]::SetEnvironmentVariable("https_proxy", $null, "User")

# 删除系统级别的永久变量(需要管理员权限)
[Environment]::SetEnvironmentVariable("http_proxy", $null, "Machine")
[Environment]::SetEnvironmentVariable("https_proxy", $null, "Machine")