Loading https://api.github.com/repos/emmetio/pyv8-binaries/contents 请求的是这个地址,自己配置项hosts,让它指向你的服务,然后返回如下的字符串:
[ { "name": ".gitignore", "path": ".gitignore", "sha": "496ee2ca6a2f08396a4076fe43dedf3dc0da8b6d", "size": 9, "url": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/.gitignore?ref=master", "html_url": "https://github.com/emmetio/pyv8-binaries/blob/master/.gitignore", "git_url": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/496ee2ca6a2f08396a4076fe43dedf3dc0da8b6d", "download_url": "https://raw.githubusercontent.com/emmetio/pyv8-binaries/master/.gitignore", "type": "file", "_links": { "self": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/.gitignore?ref=master", "git": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/496ee2ca6a2f08396a4076fe43dedf3dc0da8b6d", "html": "https://github.com/emmetio/pyv8-binaries/blob/master/.gitignore" } }, { "name": "README.md", "path": "README.md", "sha": "f305d92451a5e5bcc0e345151ca981474e7f744c", "size": 1699, "url": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/README.md?ref=master", "html_url": "https://github.com/emmetio/pyv8-binaries/blob/master/README.md", "git_url": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/f305d92451a5e5bcc0e345151ca981474e7f744c", "download_url": "https://raw.githubusercontent.com/emmetio/pyv8-binaries/master/README.md", "type": "file", "_links": { "self": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/README.md?ref=master", "git": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/f305d92451a5e5bcc0e345151ca981474e7f744c", "html": "https://github.com/emmetio/pyv8-binaries/blob/master/README.md" } }, { "name": "pyv8-linux32-p3.zip", "path": "pyv8-linux32-p3.zip", "sha": "f60af1cdf57fce96dcfb08333c8b843be5257b62", "size": 7813444, "url": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-linux32-p3.zip?ref=master", "html_url": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-linux32-p3.zip", "git_url": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/f60af1cdf57fce96dcfb08333c8b843be5257b62", "download_url": "https://raw.githubusercontent.com/emmetio/pyv8-binaries/master/pyv8-linux32-p3.zip", "type": "file", "_links": { "self": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-linux32-p3.zip?ref=master", "git": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/f60af1cdf57fce96dcfb08333c8b843be5257b62", "html": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-linux32-p3.zip" } }, { "name": "pyv8-linux32.zip", "path": "pyv8-linux32.zip", "sha": "ac6d2a1c876d1622aaa39cc77bdeec8f09ae86ae", "size": 7889216, "url": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-linux32.zip?ref=master", "html_url": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-linux32.zip", "git_url": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/ac6d2a1c876d1622aaa39cc77bdeec8f09ae86ae", "download_url": "https://raw.githubusercontent.com/emmetio/pyv8-binaries/master/pyv8-linux32.zip", "type": "file", "_links": { "self": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-linux32.zip?ref=master", "git": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/ac6d2a1c876d1622aaa39cc77bdeec8f09ae86ae", "html": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-linux32.zip" } }, { "name": "pyv8-linux64-p3.zip", "path": "pyv8-linux64-p3.zip", "sha": "a22304a4e9bc98da62467b3d3fad8eaac83b5c39", "size": 7890108, "url": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-linux64-p3.zip?ref=master", "html_url": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-linux64-p3.zip", "git_url": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/a22304a4e9bc98da62467b3d3fad8eaac83b5c39", "download_url": "https://raw.githubusercontent.com/emmetio/pyv8-binaries/master/pyv8-linux64-p3.zip", "type": "file", "_links": { "self": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-linux64-p3.zip?ref=master", "git": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/a22304a4e9bc98da62467b3d3fad8eaac83b5c39", "html": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-linux64-p3.zip" } }, { "name": "pyv8-linux64.zip", "path": "pyv8-linux64.zip", "sha": "29fc9f71cffb9e766cff25e7b50ede86837bee8f", "size": 8018554, "url": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-linux64.zip?ref=master", "html_url": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-linux64.zip", "git_url": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/29fc9f71cffb9e766cff25e7b50ede86837bee8f", "download_url": "https://raw.githubusercontent.com/emmetio/pyv8-binaries/master/pyv8-linux64.zip", "type": "file", "_links": { "self": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-linux64.zip?ref=master", "git": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/29fc9f71cffb9e766cff25e7b50ede86837bee8f", "html": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-linux64.zip" } }, { "name": "pyv8-mac106.zip", "path": "pyv8-mac106.zip", "sha": "da8d1110d23c6eba79e86dd78792ef69340e59ea", "size": 3119644, "url": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-mac106.zip?ref=master", "html_url": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-mac106.zip", "git_url": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/da8d1110d23c6eba79e86dd78792ef69340e59ea", "download_url": "https://raw.githubusercontent.com/emmetio/pyv8-binaries/master/pyv8-mac106.zip", "type": "file", "_links": { "self": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-mac106.zip?ref=master", "git": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/da8d1110d23c6eba79e86dd78792ef69340e59ea", "html": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-mac106.zip" } }, { "name": "pyv8-osx-p3.zip", "path": "pyv8-osx-p3.zip", "sha": "cac719a547387675ff3d06804fb91691eae78c2d", "size": 2937636, "url": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-osx-p3.zip?ref=master", "html_url": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-osx-p3.zip", "git_url": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/cac719a547387675ff3d06804fb91691eae78c2d", "download_url": "https://raw.githubusercontent.com/emmetio/pyv8-binaries/master/pyv8-osx-p3.zip", "type": "file", "_links": { "self": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-osx-p3.zip?ref=master", "git": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/cac719a547387675ff3d06804fb91691eae78c2d", "html": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-osx-p3.zip" } }, { "name": "pyv8-osx.zip", "path": "pyv8-osx.zip", "sha": "156096456024e99193094adc3bf24aa589275cc8", "size": 3055650, "url": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-osx.zip?ref=master", "html_url": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-osx.zip", "git_url": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/156096456024e99193094adc3bf24aa589275cc8", "download_url": "https://raw.githubusercontent.com/emmetio/pyv8-binaries/master/pyv8-osx.zip", "type": "file", "_links": { "self": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-osx.zip?ref=master", "git": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/156096456024e99193094adc3bf24aa589275cc8", "html": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-osx.zip" } }, { "name": "pyv8-win32-p3.zip", "path": "pyv8-win32-p3.zip", "sha": "8e1f9de32e4cb350c0587a6ab3b8bc54a3d42ed6", "size": 1620867, "url": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-win32-p3.zip?ref=master", "html_url": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-win32-p3.zip", "git_url": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/8e1f9de32e4cb350c0587a6ab3b8bc54a3d42ed6", "download_url": "https://raw.githubusercontent.com/emmetio/pyv8-binaries/master/pyv8-win32-p3.zip", "type": "file", "_links": { "self": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-win32-p3.zip?ref=master", "git": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/8e1f9de32e4cb350c0587a6ab3b8bc54a3d42ed6", "html": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-win32-p3.zip" } }, { "name": "pyv8-win32.zip", "path": "pyv8-win32.zip", "sha": "4dba00a2887ac1490d9d543245745689ebebf669", "size": 1605924, "url": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-win32.zip?ref=master", "html_url": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-win32.zip", "git_url": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/4dba00a2887ac1490d9d543245745689ebebf669", "download_url": "https://raw.githubusercontent.com/emmetio/pyv8-binaries/master/pyv8-win32.zip", "type": "file", "_links": { "self": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-win32.zip?ref=master", "git": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/4dba00a2887ac1490d9d543245745689ebebf669", "html": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-win32.zip" } }, { "name": "pyv8-win64-p3.zip", "path": "pyv8-win64-p3.zip", "sha": "f10748a176d49fb4b464f256f48f1a3131112596", "size": 1973979, "url": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-win64-p3.zip?ref=master", "html_url": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-win64-p3.zip", "git_url": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/f10748a176d49fb4b464f256f48f1a3131112596", "download_url": "https://raw.githubusercontent.com/emmetio/pyv8-binaries/master/pyv8-win64-p3.zip", "type": "file", "_links": { "self": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-win64-p3.zip?ref=master", "git": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/f10748a176d49fb4b464f256f48f1a3131112596", "html": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-win64-p3.zip" } }, { "name": "pyv8-win64.zip", "path": "pyv8-win64.zip", "sha": "ea0660fb5d50826c9bb408650a94acec874d7da5", "size": 2016283, "url": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-win64.zip?ref=master", "html_url": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-win64.zip", "git_url": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/ea0660fb5d50826c9bb408650a94acec874d7da5", "download_url": "https://raw.githubusercontent.com/emmetio/pyv8-binaries/master/pyv8-win64.zip", "type": "file", "_links": { "self": "https://api.github.com/repos/emmetio/pyv8-binaries/contents/pyv8-win64.zip?ref=master", "git": "https://api.github.com/repos/emmetio/pyv8-binaries/git/blobs/ea0660fb5d50826c9bb408650a94acec874d7da5", "html": "https://github.com/emmetio/pyv8-binaries/blob/master/pyv8-win64.zip" } } ]
您好,非常感谢您的回答。请问具体如何配置hosts?是把这段代码粘贴到hosts文件尾部吗?能否给个hosts文件的配置模板。
@pageye: 不是哈,如何配置hosts文件,建议你查下网上。这个是pyV8发起的对外请求。
原理就是将pyV8的请求转向到你自己写的服务器上,这样来避开外网访问。
另外,推荐VS Code编译器。
@幻天芒: 我大致了解了一下hosts文件,可以这么做吗?
0.0.0.0 https://api.github.com/repos/emmetio/pyv8-binaries/contents 将请求的网站进行重定向以达到屏蔽的目的。是这个意思吗?
@pageye: 大概是这个意思,但是似乎你需要指定一个可访问的地址。你这个hosts配置文件有点问题。不过思路是这样的。