[GH-ISSUE #3391] Http 类型代理 提示 do http proxy request error EOF #2710

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

Originally created by @xuxiangyang on GitHub (Apr 9, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3391

Bug Description

出于安全考虑,下面的例子中涉及的配置和日志,我把服务器ip改为了39.39.39.39,一级域名改为了example.com

服务器在阿里云,centos,防火墙和安全组配置没有问题。

客户端在openwrt软路由上,软路由ip是 192.168.168.2 , web端路由端口在80上,也开通了 22 的ssh端口。

目前 TCP层代理是可以正常访问的。但是HTTP访问会提示 404。

能搜到的方案都试了,没能解决。麻烦帮忙看下。

frpc Version

0.47.0

frps Version

0.47.0

System Architecture

linux/amd64 和 linux/aarch64

Configurations

server端配置如下

[common]
bind_port = 7000
vhost_http_port = 7000

dashboard_addr = 127.0.0.1
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = fakepass
dashboard_tls_mode = false

log_level = trace
log_max_days = 3

authentication_method = token
token = faketoken

client端配置如下

[common]
server_addr=39.39.39.39
server_port=7000
token=faketoken
user=openwrt
log_level=trace
log_max_days=3
protocol=tcp
log_file=/var/etc/frp/frpc.log
pool_count=1
admin_addr=0.0.0.0
admin_port=7400
admin_user=admin
admin_pwd=password
tcp_mux=true
tls_enable=false
login_fail_exit=false

[openwrt-ssh]
type=tcp
remote_port=7100
local_ip=192.168.168.2
local_port=22
use_encryption=true
use_compression=true

[openwrt-web]
type=http
custom_domains=openwrt.example.com
local_ip=192.168.168.2
local_port=80
proxy_protocol_version=v2
use_encryption=true
use_compression=true

Logs

server端关键日志如下

2023/04/09 18:30:21 [D] [http.go:146] get new HTTP request host [openwrt.example.com] path [/] httpuser []
2023/04/09 18:30:21 [D] [control.go:247] [d063f9b77cb1022d] get work connection from pool
2023/04/09 18:30:21 [D] [proxy.go:108] [d063f9b77cb1022d] [openwrt.openwrt-web] get a new work connection: [223.72.38.81:4804]
2023/04/09 18:30:21 [D] [control.go:218] [d063f9b77cb1022d] new work connection registered
2023/04/09 18:30:40 [D] [control.go:493] [d063f9b77cb1022d] receive heartbeat
2023/04/09 18:30:51 [W] [http.go:119] do http proxy request [host: openwrt.example.com:7000] error: EOF

client端关键日志如下

2023/04/09 18:30:21 [D] [proxy_wrapper.go:231] [d063f9b77cb1022d] [openwrt.openwrt-web] start a new work connection, localAddr: 192.168.168.2:42592 remoteAddr: 39.39.39.39:7000
2023/04/09 18:30:21 [T] [proxy.go:742] [d063f9b77cb1022d] [openwrt.openwrt-web] handle tcp work connection, use_encryption: true, use_compression: true
2023/04/09 18:30:21 [D] [proxy.go:807] [d063f9b77cb1022d] [openwrt.openwrt-web] join connections, localConn(l[192.168.168.2:58380] r[192.168.168.2:80]) workConn(l[192.168.168.2:42592] r[39.39.39.39:7000])
2023/04/09 18:30:40 [D] [control.go:286] [d063f9b77cb1022d] send heartbeat to server
2023/04/09 18:30:40 [D] [control.go:317] [d063f9b77cb1022d] receive heartbeat from server
2023/04/09 18:30:51 [D] [proxy.go:819] [d063f9b77cb1022d] [openwrt.openwrt-web] join connections closed

Steps to reproduce

  1. 按照我提供的server端配置server
  2. 在nano pi r4se 配置 DHDAXCW 硬件, https://github.com/DHDAXCW/NanoPi-R4S-R4SEdocker-friendlyarm_nanopi-r4s-squashfs-sysupgrade.img.gz 配件
  3. openwrt 配置 client端
  4. 修改域名 *.example.com指向 39.39.39.39
  5. 访问 http://openwrt.example.com:7000/

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @xuxiangyang on GitHub (Apr 9, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3391 ### Bug Description 出于安全考虑,下面的例子中涉及的配置和日志,我把服务器ip改为了`39.39.39.39`,一级域名改为了`example.com` 服务器在阿里云,centos,防火墙和安全组配置没有问题。 客户端在openwrt软路由上,软路由ip是 `192.168.168.2` , web端路由端口在80上,也开通了 `22` 的ssh端口。 目前 TCP层代理是可以正常访问的。但是HTTP访问会提示 404。 能搜到的方案都试了,没能解决。麻烦帮忙看下。 ### frpc Version 0.47.0 ### frps Version 0.47.0 ### System Architecture linux/amd64 和 linux/aarch64 ### Configurations server端配置如下 ``` [common] bind_port = 7000 vhost_http_port = 7000 dashboard_addr = 127.0.0.1 dashboard_port = 7500 dashboard_user = admin dashboard_pwd = fakepass dashboard_tls_mode = false log_level = trace log_max_days = 3 authentication_method = token token = faketoken ``` client端配置如下 ``` [common] server_addr=39.39.39.39 server_port=7000 token=faketoken user=openwrt log_level=trace log_max_days=3 protocol=tcp log_file=/var/etc/frp/frpc.log pool_count=1 admin_addr=0.0.0.0 admin_port=7400 admin_user=admin admin_pwd=password tcp_mux=true tls_enable=false login_fail_exit=false [openwrt-ssh] type=tcp remote_port=7100 local_ip=192.168.168.2 local_port=22 use_encryption=true use_compression=true [openwrt-web] type=http custom_domains=openwrt.example.com local_ip=192.168.168.2 local_port=80 proxy_protocol_version=v2 use_encryption=true use_compression=true ``` ### Logs server端关键日志如下 ``` 2023/04/09 18:30:21 [D] [http.go:146] get new HTTP request host [openwrt.example.com] path [/] httpuser [] 2023/04/09 18:30:21 [D] [control.go:247] [d063f9b77cb1022d] get work connection from pool 2023/04/09 18:30:21 [D] [proxy.go:108] [d063f9b77cb1022d] [openwrt.openwrt-web] get a new work connection: [223.72.38.81:4804] 2023/04/09 18:30:21 [D] [control.go:218] [d063f9b77cb1022d] new work connection registered 2023/04/09 18:30:40 [D] [control.go:493] [d063f9b77cb1022d] receive heartbeat 2023/04/09 18:30:51 [W] [http.go:119] do http proxy request [host: openwrt.example.com:7000] error: EOF ``` client端关键日志如下 ``` 2023/04/09 18:30:21 [D] [proxy_wrapper.go:231] [d063f9b77cb1022d] [openwrt.openwrt-web] start a new work connection, localAddr: 192.168.168.2:42592 remoteAddr: 39.39.39.39:7000 2023/04/09 18:30:21 [T] [proxy.go:742] [d063f9b77cb1022d] [openwrt.openwrt-web] handle tcp work connection, use_encryption: true, use_compression: true 2023/04/09 18:30:21 [D] [proxy.go:807] [d063f9b77cb1022d] [openwrt.openwrt-web] join connections, localConn(l[192.168.168.2:58380] r[192.168.168.2:80]) workConn(l[192.168.168.2:42592] r[39.39.39.39:7000]) 2023/04/09 18:30:40 [D] [control.go:286] [d063f9b77cb1022d] send heartbeat to server 2023/04/09 18:30:40 [D] [control.go:317] [d063f9b77cb1022d] receive heartbeat from server 2023/04/09 18:30:51 [D] [proxy.go:819] [d063f9b77cb1022d] [openwrt.openwrt-web] join connections closed ``` ### Steps to reproduce 1. 按照我提供的server端配置server 2. 在nano pi r4se 配置 DHDAXCW 硬件, https://github.com/DHDAXCW/NanoPi-R4S-R4SE 的 `docker-friendlyarm_nanopi-r4s-squashfs-sysupgrade.img.gz` 配件 3. openwrt 配置 client端 4. 修改域名 *.example.com指向 39.39.39.39 5. 访问 http://openwrt.example.com:7000/ ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@xuxiangyang commented on GitHub (Apr 10, 2023):

关闭了 proxy_protocol_version 正常了,这个看起来需要内网服务支持。参考 协议

<!-- gh-comment-id:1501307737 --> @xuxiangyang commented on GitHub (Apr 10, 2023): 关闭了 proxy_protocol_version 正常了,这个看起来需要内网服务支持。参考 [协议](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)
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#2710
No description provided.