A way to speed up vcpkg download. 加速 vcpkg 下载 #17535
Replies: 5 comments 6 replies
-
@cathaysia I am not a Chinese speaker but was able to use Bing Translate to get this translated emm, I'm not good at English, expect a translation. The principle is very simple, is to open a local agent, and then vcpkg request host and url to speed up the site, my side ghproxy.com the best speed, below I use Fiddler as an agent, with nginx and so on should be OK, but these I am not very clear. Open Fiddler, and then click Tools - Options - HTTPS to tick the following: If you are prompted to install the ssl certificate during this period, agree. Then change the port of Fiddler to 8888 (any, I'll default here to 8888) Then click on the rules in the menu bar - and customize the rules. Look for the function and add the following two lines of function:onBeforeRequest if(oSession.host == "github.com:443" || oSession.host == "raw.githubusercontent.com:443"){ set HTTPS_PROXY = localhost:8888 。。。 I put this article https://www.jianshu.com/p/4dfbe353be0f. But the article is locked and I don't know if it was unsealed by the time you looked it up |
Beta Was this translation helpful? Give feedback.
-
更新到5月5号的版本,可以使用自动代理检测了,详见PR:microsoft/vcpkg-tool#49 English Translation: Please update to vcpkg.exe version 2021-05-05 (by All you need to do is ensure this Windows 10 proxy setting page is set by your proxy software like this: It will then automatically detects it (called IE Proxy Setting) and use it for download. |
Beta Was this translation helpful? Give feedback.
-
其实mirror的PR好了我们就可以从国内直接下载了。 |
Beta Was this translation helpful? Give feedback.
-
@cnSchwarzer 你确定那个 PR 可以正常工作吗?我使用新版本的时候发现 Fiddler 一直捕获不到 vcpkg 的流量。使用二月份版本的时候倒是能正常工作。 可否只在用户没有设置 HTTP_PROXY 的时候设置它?不要让它覆盖我手动设置的变量? |
Beta Was this translation helpful? Give feedback.
-
For Chinese users: |
Beta Was this translation helpful? Give feedback.
-
Chinese | English
English translation thanks to @pratikpc
原理很简单,就是本地开个代理,然后将 vcpkg 请求的 host 和 url 改成加速网站的,目前我这边 ghproxy.com 速度最佳,下面我用 Fiddler 做代理,用 nginx 等应该也行,但是这些我就不是很清楚了。
打开 Fiddler,然后点击 《工具->选项->HTTPS》,将以下内容打勾:
如果这期间提示要安装 ssl 证书,同意即可。
然后将 Fiddler 的端口改成 8888(任意,我这里默认就是 8888)
然后点击菜单栏的 规则 -> 自定义规则。 找打
onBeforeRequest
函数,添加下面两行函数:然后在 CMD 中执行
shell 同理,只要设置两个环境变量就行了
。。。
需要注意的是:由于 Fiddler 会自动拦截浏览器的请求,因此在 vcpkg 安装的过程中可能会导致浏览器无法访问 github,这是由于 Fiddler 拦截请求导致的。安装完后关闭 Fiddler 即可。
Beta Was this translation helpful? Give feedback.
All reactions