181 字
1 分钟
解决 github Failed to connect to github.com port 443

由于一个不能说的秘密,windows平台上github上传代码时会遇到这样的问题:

 Failed to connect to github.com port 443 after 21081 ms: Couldn't connect to server

这是代理无效的问题,直接设置终端代理解决:

  • windows的cmd设置代理:
set http_proxy=http://127.0.0.1:7890
set https_proxy=http://127.0.0.1:7890
  • 使用windows的powershell设置代理:
$env:http_proxy="http://127.0.0.1:7890"
$env:https_proxy="http://127.0.0.1:7890"

注意#

  • 命令中的主机号(127.0.0.1)是使用的代理的主机号,自己电脑有vpn则本机则可以看作是访问github的代理主机,通常为127.0.0.1,否则需要填入代理主机的ip。
  • 命令中的端口号(7890)是代理软件或代理主机的监听端口,可以从代理服务器的配置中获得。

port localhost

解决 github Failed to connect to github.com port 443
https://www.piczi.top/posts/git-proxy/
作者
Piczi
发布于
2024-01-08
许可协议
CC BY-NC-SA 4.0