[GH-ISSUE #422] HTTP代理访问Github会经常出现 Fastly error: unknown domain: github.com. #330

Open
opened 2026-02-27 23:16:30 +03:00 by kerem · 4 comments
Owner

Originally created by @QLeelulu on GitHub (Apr 6, 2021).
Original GitHub issue: https://github.com/snail007/goproxy/issues/422

启动参数

./proxy http -p :80 --forever --log proxy.log --dns-ttl=60 --dns-address=8.8.8.8:53 --intelligent=direct
./proxy http -p :443 --forever --log proxy.log --dns-ttl=60 --dns-address=8.8.8.8:53 --intelligent=direct

访问 Github经常出现 :

image

访问 MongoDB 相关网站经常出现 :

image

从Chrome的控制台看出问题的都是 http2 请求:

image

当出现以上问题时,在Chrome里执行以下Close idle sockets操作就可以暂时正常访问:

image

Originally created by @QLeelulu on GitHub (Apr 6, 2021). Original GitHub issue: https://github.com/snail007/goproxy/issues/422 ## 启动参数 ``` ./proxy http -p :80 --forever --log proxy.log --dns-ttl=60 --dns-address=8.8.8.8:53 --intelligent=direct ./proxy http -p :443 --forever --log proxy.log --dns-ttl=60 --dns-address=8.8.8.8:53 --intelligent=direct ``` ### 访问 Github经常出现 : ![image](https://user-images.githubusercontent.com/570889/113649527-2b0c1a00-96c1-11eb-8491-f7dbf59b6e99.png) ### 访问 MongoDB 相关网站经常出现 : ![image](https://user-images.githubusercontent.com/570889/113649581-437c3480-96c1-11eb-905c-8774aa34e50d.png) ### 从Chrome的控制台看出问题的都是 http2 请求: ![image](https://user-images.githubusercontent.com/570889/113649649-64448a00-96c1-11eb-8c75-cd14b73471f8.png) ### 当出现以上问题时,在Chrome里执行以下`Close idle sockets`操作就可以暂时正常访问: ![image](https://user-images.githubusercontent.com/570889/113649801-ad94d980-96c1-11eb-90fd-e7fc926eecb3.png)
Author
Owner

@snail007 commented on GitHub (Apr 6, 2021):

反向代理不支持http2

<!-- gh-comment-id:813799495 --> @snail007 commented on GitHub (Apr 6, 2021): 反向代理不支持http2
Author
Owner

@QLeelulu commented on GitHub (Apr 20, 2021):

@snail007 相当于正向代理用法,从我们的使用情况来看,是支持http2的,只是有几个网站(例如 github.com、mongodb.com)会出现这种情况

<!-- gh-comment-id:822915564 --> @QLeelulu commented on GitHub (Apr 20, 2021): @snail007 相当于正向代理用法,从我们的使用情况来看,是支持http2的,只是有几个网站(例如 github.com、mongodb.com)会出现这种情况
Author
Owner

@mistyworm commented on GitHub (Jun 23, 2021):

我用socks代理,最近也出现github无法访问的情况,其它网站可以

<!-- gh-comment-id:866485177 --> @mistyworm commented on GitHub (Jun 23, 2021): 我用socks代理,最近也出现github无法访问的情况,其它网站可以
Author
Owner

@peasoft commented on GitHub (Jul 15, 2024):

出现这个问题的原因是 HTTP/2 的多路复用将 github.com 这一未托管在 Fastly 上的网站传到了某个在 Fastly 上的子域名里。

从我们的使用情况来看,是支持http2的

@snail007 说得对,直到目前仍没有一个反向代理是完美支持 HTTP/2 的多路复用的。具体可以看 https://github.com/haproxy/haproxy/issues/2636
我有一种很 Hacky 的做法能解决这个问题但是我先留着不说

只是有几个网站(例如 github.com、mongodb.com)会出现这种情况

因为正好只有这些网站是使用泛域名证书的(github.com 主站没有用,但是子域名用了),而多路复用仅在多个网站证书相同时被使用。

Close idle sockets 本质上就是强行让下一个请求“换一路”,所以那个上面那个 issue 给出的解决办法(也是最正常的解决办法)就是让反代检测到数据传输结束时不要 keep-alive,而是立即断开连接。

<!-- gh-comment-id:2227716283 --> @peasoft commented on GitHub (Jul 15, 2024): 出现这个问题的原因是 `HTTP/2` 的多路复用将 `github.com` 这一未托管在 Fastly 上的网站传到了某个在 Fastly 上的子域名里。 > 从我们的使用情况来看,是支持http2的 @snail007 说得对,直到目前仍没有一个反向代理是完美支持 `HTTP/2` 的多路复用的。具体可以看 <https://github.com/haproxy/haproxy/issues/2636> ~~我有一种很 Hacky 的做法能解决这个问题但是我先留着不说~~ > 只是有几个网站(例如 github.com、mongodb.com)会出现这种情况 因为正好只有这些网站是使用泛域名证书的(github.com 主站没有用,但是子域名用了),而多路复用仅在多个网站证书相同时被使用。 `Close idle sockets` 本质上就是强行让下一个请求“换一路”,所以那个上面那个 issue 给出的解决办法(也是最正常的解决办法)就是让反代检测到数据传输结束时不要 `keep-alive`,而是立即断开连接。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/goproxy#330
No description provided.