[GH-ISSUE #2478] https2http连接不成功 #1966

Closed
opened 2026-05-05 13:16:01 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @z0ow on GitHub (Jul 10, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2478

服务端配置和客户端配置与样例中给的基本一致,只改动了服务端的地址和token。

现在的情况是:

  1. 若server和client在同一机器上,可以通过https2http正常连接网站(例如frp.examlpe.com)
  2. 若server为一具有公网IP的机器,client为在一NAT转发的内网机器,https2https连接不正常,通过日志可以看到浏览器请求frp.example.com时有报错

客户端错误日志(已隐去敏感信息):

2021/07/10 16:52:42 [I] [control.go:180] [355aa8bb14af5542] [mgmt-cloud] start proxy success
2021/07/10 16:52:42 [I] [control.go:180] [355aa8bb14af5542] [mgmt-gitlab-ssl] start proxy success
2021/07/10 16:52:59 [D] [proxy_wrapper.go:231] [355aa8bb14af5542] [mgmt-gitlab-ssl] start a new work connection, localAddr: 192.168.100.252:60050 remoteAddr: *SERVER_IP_ADDR*:7000
2021/07/10 16:52:59 [D] [proxy.go:788] [355aa8bb14af5542] [mgmt-gitlab-ssl] handle by plugin: https2http
2021/07/10 16:52:59 [D] [proxy.go:790] [355aa8bb14af5542] [mgmt-gitlab-ssl] handle by plugin finished
2021/07/10 16:52:59 [D] [proxy_wrapper.go:231] [355aa8bb14af5542] [mgmt-gitlab-ssl] start a new work connection, localAddr: 192.168.100.252:60050 remoteAddr: *SERVER_IP_ADDR*:7000
2021/07/10 16:52:59 [D] [proxy.go:788] [355aa8bb14af5542] [mgmt-gitlab-ssl] handle by plugin: https2http
2021/07/10 16:52:59 [D] [proxy.go:790] [355aa8bb14af5542] [mgmt-gitlab-ssl] handle by plugin finished
2021/07/10 16:53:12 [D] [control.go:315] [355aa8bb14af5542] send heartbeat to server
2021/07/10 16:53:12 [D] [control.go:346] [355aa8bb14af5542] receive heartbeat from server
2021/07/10 16:53:42 [D] [control.go:315] [355aa8bb14af5542] send heartbeat to server
2021/07/10 16:53:42 [D] [control.go:346] [355aa8bb14af5542] receive heartbeat from server

服务端错误日志(已隐去敏感信息和其它客户端):

2021/07/10 16:52:42 [D] [control.go:219] [355aa8bb14af5542] new work connection registered
2021/07/10 16:52:42 [I] [http.go:92] [355aa8bb14af5542] [mgmt-cloud] http proxy listen for host [*SERVER_ADDR*] location [] group []
2021/07/10 16:52:42 [I] [control.go:444] [355aa8bb14af5542] new proxy [mgmt-cloud] success
2021/07/10 16:52:42 [I] [https.go:51] [355aa8bb14af5542] [mgmt-gitlab-ssl] https proxy listen for host [*SERVER_ADDR*]
2021/07/10 16:52:42 [I] [control.go:444] [355aa8bb14af5542] new proxy [mgmt-gitlab-ssl] success
2021/07/10 16:52:59 [D] [vhost.go:191] [355aa8bb14af5542] [mgmt-gitlab-ssl] get new http request host [*SERVER_ADDR*] path []
2021/07/10 16:52:59 [I] [proxy.go:162] [355aa8bb14af5542] [mgmt-gitlab-ssl] get a user connection [*SERVER_IP_ADDR*:18187]
2021/07/10 16:52:59 [D] [control.go:248] [355aa8bb14af5542] get work connection from pool
2021/07/10 16:52:59 [D] [proxy.go:103] [355aa8bb14af5542] [mgmt-gitlab-ssl] get a new work connection: [*SERVER_IP_ADDR*:18157]
2021/07/10 16:52:59 [D] [proxy.go:273] [355aa8bb14af5542] [mgmt-gitlab-ssl] join connections, workConn(l[192.168.1.145:7000] r[*SERVER_IP_ADDR*:18157]) userConn(l[192.168.1.145:2443] r[*SERVER_IP_ADDR*:18187])
2021/07/10 16:52:59 [D] [vhost.go:191] [355aa8bb14af5542] [mgmt-gitlab-ssl] get new http request host [*SERVER_ADDR*] path []
2021/07/10 16:52:59 [I] [proxy.go:162] [355aa8bb14af5542] [mgmt-gitlab-ssl] get a user connection [*SERVER_IP_ADDR*:18188]
2021/07/10 16:52:59 [D] [control.go:219] [355aa8bb14af5542] new work connection registered
2021/07/10 16:52:59 [D] [proxy.go:103] [355aa8bb14af5542] [mgmt-gitlab-ssl] get a new work connection: [*SERVER_IP_ADDR*:18157]
2021/07/10 16:52:59 [D] [proxy.go:273] [355aa8bb14af5542] [mgmt-gitlab-ssl] join connections, workConn(l[192.168.1.145:7000] r[*SERVER_IP_ADDR*:18157]) userConn(l[192.168.1.145:2443] r[*SERVER_IP_ADDR*:18188])
2021/07/10 16:52:59 [D] [control.go:219] [355aa8bb14af5542] new work connection registered
2021/07/10 16:52:59 [D] [control.go:219] [355aa8bb14af5542] new work connection registered
2021/07/10 16:53:12 [D] [control.go:473] [355aa8bb14af5542] receive heartbeat
2021/07/10 16:53:38 [D] [proxy.go:283] [355aa8bb14af5542] [mgmt-gitlab-ssl] join connections closed
2021/07/10 16:53:42 [D] [control.go:473] [355aa8bb14af5542] receive heartbeat

在16:53:38的join connections closed是因为长时间连接无效手动在浏览器关闭了连接,如果不关闭连接,chrome等非常长的时间后会报HTTP ERROR 503或者直接ERR_TIMED_OUT(若报超时,服务端看不到join信息)。

目前测试结果可以确认的其它信息:

  1. 客户端和服务端同在一台机器上可以正常使用https2http
  2. 客户端和服务端在局域网内不同设备没有测试
  3. 客户端在内网服务端在外网,两台设备使用的端口经过firewall-cmd测试均是开放的,服务端供应商的访问策略是全开放(由自己手动管理),无法正常使用https2http,但是tcp相关的连接正常

请问这个问题是bug吗,还是有一些其它的原因导致的,或者能不能进一步测试得到一些信息(debug模式的log输出的信息感觉仍然非常有限)。

Originally created by @z0ow on GitHub (Jul 10, 2021). Original GitHub issue: https://github.com/fatedier/frp/issues/2478 服务端配置和客户端配置与样例中给的基本一致,只改动了服务端的地址和token。 现在的情况是: 1. 若server和client在同一机器上,可以通过https2http正常连接网站(例如frp.examlpe.com) 2. 若server为一具有公网IP的机器,client为在一NAT转发的内网机器,https2https连接不正常,通过日志可以看到浏览器请求frp.example.com时有报错 客户端错误日志(已隐去敏感信息): ``` 2021/07/10 16:52:42 [I] [control.go:180] [355aa8bb14af5542] [mgmt-cloud] start proxy success 2021/07/10 16:52:42 [I] [control.go:180] [355aa8bb14af5542] [mgmt-gitlab-ssl] start proxy success 2021/07/10 16:52:59 [D] [proxy_wrapper.go:231] [355aa8bb14af5542] [mgmt-gitlab-ssl] start a new work connection, localAddr: 192.168.100.252:60050 remoteAddr: *SERVER_IP_ADDR*:7000 2021/07/10 16:52:59 [D] [proxy.go:788] [355aa8bb14af5542] [mgmt-gitlab-ssl] handle by plugin: https2http 2021/07/10 16:52:59 [D] [proxy.go:790] [355aa8bb14af5542] [mgmt-gitlab-ssl] handle by plugin finished 2021/07/10 16:52:59 [D] [proxy_wrapper.go:231] [355aa8bb14af5542] [mgmt-gitlab-ssl] start a new work connection, localAddr: 192.168.100.252:60050 remoteAddr: *SERVER_IP_ADDR*:7000 2021/07/10 16:52:59 [D] [proxy.go:788] [355aa8bb14af5542] [mgmt-gitlab-ssl] handle by plugin: https2http 2021/07/10 16:52:59 [D] [proxy.go:790] [355aa8bb14af5542] [mgmt-gitlab-ssl] handle by plugin finished 2021/07/10 16:53:12 [D] [control.go:315] [355aa8bb14af5542] send heartbeat to server 2021/07/10 16:53:12 [D] [control.go:346] [355aa8bb14af5542] receive heartbeat from server 2021/07/10 16:53:42 [D] [control.go:315] [355aa8bb14af5542] send heartbeat to server 2021/07/10 16:53:42 [D] [control.go:346] [355aa8bb14af5542] receive heartbeat from server ``` 服务端错误日志(已隐去敏感信息和其它客户端): ``` 2021/07/10 16:52:42 [D] [control.go:219] [355aa8bb14af5542] new work connection registered 2021/07/10 16:52:42 [I] [http.go:92] [355aa8bb14af5542] [mgmt-cloud] http proxy listen for host [*SERVER_ADDR*] location [] group [] 2021/07/10 16:52:42 [I] [control.go:444] [355aa8bb14af5542] new proxy [mgmt-cloud] success 2021/07/10 16:52:42 [I] [https.go:51] [355aa8bb14af5542] [mgmt-gitlab-ssl] https proxy listen for host [*SERVER_ADDR*] 2021/07/10 16:52:42 [I] [control.go:444] [355aa8bb14af5542] new proxy [mgmt-gitlab-ssl] success 2021/07/10 16:52:59 [D] [vhost.go:191] [355aa8bb14af5542] [mgmt-gitlab-ssl] get new http request host [*SERVER_ADDR*] path [] 2021/07/10 16:52:59 [I] [proxy.go:162] [355aa8bb14af5542] [mgmt-gitlab-ssl] get a user connection [*SERVER_IP_ADDR*:18187] 2021/07/10 16:52:59 [D] [control.go:248] [355aa8bb14af5542] get work connection from pool 2021/07/10 16:52:59 [D] [proxy.go:103] [355aa8bb14af5542] [mgmt-gitlab-ssl] get a new work connection: [*SERVER_IP_ADDR*:18157] 2021/07/10 16:52:59 [D] [proxy.go:273] [355aa8bb14af5542] [mgmt-gitlab-ssl] join connections, workConn(l[192.168.1.145:7000] r[*SERVER_IP_ADDR*:18157]) userConn(l[192.168.1.145:2443] r[*SERVER_IP_ADDR*:18187]) 2021/07/10 16:52:59 [D] [vhost.go:191] [355aa8bb14af5542] [mgmt-gitlab-ssl] get new http request host [*SERVER_ADDR*] path [] 2021/07/10 16:52:59 [I] [proxy.go:162] [355aa8bb14af5542] [mgmt-gitlab-ssl] get a user connection [*SERVER_IP_ADDR*:18188] 2021/07/10 16:52:59 [D] [control.go:219] [355aa8bb14af5542] new work connection registered 2021/07/10 16:52:59 [D] [proxy.go:103] [355aa8bb14af5542] [mgmt-gitlab-ssl] get a new work connection: [*SERVER_IP_ADDR*:18157] 2021/07/10 16:52:59 [D] [proxy.go:273] [355aa8bb14af5542] [mgmt-gitlab-ssl] join connections, workConn(l[192.168.1.145:7000] r[*SERVER_IP_ADDR*:18157]) userConn(l[192.168.1.145:2443] r[*SERVER_IP_ADDR*:18188]) 2021/07/10 16:52:59 [D] [control.go:219] [355aa8bb14af5542] new work connection registered 2021/07/10 16:52:59 [D] [control.go:219] [355aa8bb14af5542] new work connection registered 2021/07/10 16:53:12 [D] [control.go:473] [355aa8bb14af5542] receive heartbeat 2021/07/10 16:53:38 [D] [proxy.go:283] [355aa8bb14af5542] [mgmt-gitlab-ssl] join connections closed 2021/07/10 16:53:42 [D] [control.go:473] [355aa8bb14af5542] receive heartbeat ``` 在16:53:38的join connections closed是因为长时间连接无效手动在浏览器关闭了连接,如果不关闭连接,chrome等非常长的时间后会报HTTP ERROR 503或者直接ERR_TIMED_OUT(若报超时,服务端看不到join信息)。 目前测试结果可以确认的其它信息: 1. 客户端和服务端同在一台机器上可以正常使用https2http 2. 客户端和服务端在局域网内不同设备没有测试 3. 客户端在内网服务端在外网,两台设备使用的端口经过firewall-cmd测试均是开放的,服务端供应商的访问策略是全开放(由自己手动管理),无法正常使用https2http,但是tcp相关的连接正常 请问这个问题是bug吗,还是有一些其它的原因导致的,或者能不能进一步测试得到一些信息(debug模式的log输出的信息感觉仍然非常有限)。
Author
Owner

@z0ow commented on GitHub (Jul 11, 2021):

=-= 突然又可以用了……迷幻

<!-- gh-comment-id:877765470 --> @z0ow commented on GitHub (Jul 11, 2021): =-= 突然又可以用了……迷幻
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: github-starred/frp#1966
No description provided.