[GH-ISSUE #4782] host parse error, real ip can't parse #3772

Closed
opened 2026-05-05 14:25:05 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @Lioncky on GitHub (May 3, 2025).
Original GitHub issue: https://github.com/fatedier/frp/issues/4782

Bug Description

example.com dns = 207.55.123.1
hk.example.com dns = 8.12.11.7
frpc设置http 880 自定义域 hk.example.com
访问hk.example.com:880/api 正常 但"X-Forwarded-For" =[]string len: 1, cap: 1, ["207.55.123.1 "]
子域名和主域名dns不相同 应该配置什么就是什么 主域名完全不相关也把ip传过来了

配置会报错 start error: '.' and '*' are not supported in subdomain

使用宝塔反代127.0.0.1:880直接报错404都不带解析过去的 第一次用这个 (ngix问题)
proxyproto 配置比如go的可以放文档里
tcp测试了没问题 http我是走的ngix反代 XRIP 也是可以获取到的
走反代的情况会对比host host必须设置proxy_host 这个强校验是否可以关掉?

ngrok随手就配好了 这个真的不要太复杂 奇怪的姿势太多了点

frpc Version

0.51.3

frps Version

0.51.3

System Architecture

linux/amd64

Configurations

bindPort = 7000
# proxyProtocol = true
auth.method = "token"  # 启用基于 token 的认证
auth.token = "12345678"  # 设置认证 token

# HTTP
vhostHTTPPort = 880        # HTTP 请求的虚拟主机端口
vhostHTTPSPort = 8443      # HTTPS 请求的虚拟主机端口

# Web 服务器配置,启用 Web 控制面板
webServer.addr = "0.0.0.0"  # 绑定本地地址
webServer.port = 7500         # 控制面板的端口
webServer.user = "admin"      # 控制面板用户名
webServer.password = "admin"  # 控制面板密码

# Config here to enable the ports
allowPorts = [
  { single = 880 },
  { single = 8443 },
  { single = 9988 },
  { start = 3080, end = 6000 }  # 确保允许 3080 端口
]

[common]
server_addr=168.55.186.168
server_port=7000
token=12345678
log_level=info
log_max_days=3
protocol=tcp
log_file=/var/etc/frp/frpc.log
tcp_mux=true
tls_enable=false
login_fail_exit=false

[TCP]
type=tcp
remote_port=3080
local_ip=10.0.0.1
local_port=3080
proxy_protocol_version=v2
use_encryption=false
use_compression=false

[PC]
type=http
custom_domains=127.0.0.1 # Reserve Proxy
local_ip=10.0.0.1
local_port=9988
use_encryption=false
use_compression=false

Logs

2025-05-03 02:42:58.148 [I] [frps/root.go:105] frps uses config file: /usr/bin/frps.toml
2025-05-03 02:42:58.334 [I] [server/service.go:237] frps tcp listen on 0.0.0.0:7000
2025-05-03 02:42:58.334 [I] [server/service.go:305] http service listen on 0.0.0.0:880
2025-05-03 02:42:58.334 [I] [server/service.go:319] https service listen on 0.0.0.0:8443
2025-05-03 02:42:58.334 [I] [frps/root.go:114] frps started successfully
2025-05-03 02:42:58.334 [I] [server/service.go:351] dashboard listen on 0.0.0.0:7500
2025-05-03 02:42:59.446 [I] [server/service.go:582] [a5cc564e487ae9fa] client login info: ip [136.331.243.134:3369] version [0.51.3] hostname [] os [linux] arch [arm64]
2025-05-03 02:42:59.475 [I] [proxy/tcp.go:82] [a5cc564e487ae9fa] [TCP] tcp proxy listen port [3080]
2025-05-03 02:42:59.475 [I] [server/control.go:399] [a5cc564e487ae9fa] new proxy [TCP] type [tcp] success
2025-05-03 02:42:59.475 [I] [proxy/http.go:111] [a5cc564e487ae9fa] [PC] http proxy listen for host [hk.gsdef.com] location [] group [], routeByHTTPUser []
2025-05-03 02:42:59.475 [I] [server/control.go:399] [a5cc564e487ae9fa] new proxy [PC] type [http] success
2025-05-03 02:43:46.883 [I] [proxy/proxy.go:115] [a5cc564e487ae9fa] [TCP] proxy closing
2025-05-03 02:43:46.883 [W] [proxy/proxy.go:201] [a5cc564e487ae9fa] [TCP] listener is closed: accept tcp [::]:3080: use of closed network connection
2025-05-03 02:43:46.883 [I] [proxy/proxy.go:115] [a5cc564e487ae9fa] [PC] proxy closing

2025/05/03 02:25:02 [I] [root.go:220] start frpc service for config file [/var/etc/frp/frpc.conf]
2025/05/03 02:25:02 [I] [service.go:301] [b48a50f1b6a15544] login to server success, get run id [b48a50f1b6a15544]
2025/05/03 02:25:02 [I] [proxy_manager.go:150] [b48a50f1b6a15544] proxy added: [TCP PC]
2025/05/03 02:25:02 [I] [control.go:172] [b48a50f1b6a15544] [TCP] start proxy success
2025/05/03 02:25:02 [I] [control.go:172] [b48a50f1b6a15544] [PC] start proxy success

Steps to reproduce

OpenWRT Docs 感觉不太完整 找问题太费劲了

Originally created by @Lioncky on GitHub (May 3, 2025). Original GitHub issue: https://github.com/fatedier/frp/issues/4782 ### Bug Description example.com dns = 207.55.123.1 hk.example.com dns = 8.12.11.7 frpc设置http 880 自定义域 hk.example.com 访问hk.example.com:880/api 正常 但"X-Forwarded-For" =[]string len: 1, cap: 1, ["207.55.123.1 "] 子域名和主域名dns不相同 应该配置什么就是什么 主域名完全不相关也把ip传过来了 配置会报错 `start error: '.' and '*' are not supported in subdomain` ~~使用宝塔反代127.0.0.1:880直接报错404都不带解析过去的 第一次用这个 (ngix问题)~~ proxyproto 配置比如go的可以放文档里 tcp测试了没问题 http我是走的ngix反代 XRIP 也是可以获取到的 走反代的情况会对比host host必须设置proxy_host 这个强校验是否可以关掉? ngrok随手就配好了 这个真的不要太复杂 奇怪的姿势太多了点 ### frpc Version 0.51.3 ### frps Version 0.51.3 ### System Architecture linux/amd64 ### Configurations ``` bindPort = 7000 # proxyProtocol = true auth.method = "token" # 启用基于 token 的认证 auth.token = "12345678" # 设置认证 token # HTTP vhostHTTPPort = 880 # HTTP 请求的虚拟主机端口 vhostHTTPSPort = 8443 # HTTPS 请求的虚拟主机端口 # Web 服务器配置,启用 Web 控制面板 webServer.addr = "0.0.0.0" # 绑定本地地址 webServer.port = 7500 # 控制面板的端口 webServer.user = "admin" # 控制面板用户名 webServer.password = "admin" # 控制面板密码 # Config here to enable the ports allowPorts = [ { single = 880 }, { single = 8443 }, { single = 9988 }, { start = 3080, end = 6000 } # 确保允许 3080 端口 ] ``` ``` [common] server_addr=168.55.186.168 server_port=7000 token=12345678 log_level=info log_max_days=3 protocol=tcp log_file=/var/etc/frp/frpc.log tcp_mux=true tls_enable=false login_fail_exit=false [TCP] type=tcp remote_port=3080 local_ip=10.0.0.1 local_port=3080 proxy_protocol_version=v2 use_encryption=false use_compression=false [PC] type=http custom_domains=127.0.0.1 # Reserve Proxy local_ip=10.0.0.1 local_port=9988 use_encryption=false use_compression=false ``` ### Logs ``` 2025-05-03 02:42:58.148 [I] [frps/root.go:105] frps uses config file: /usr/bin/frps.toml 2025-05-03 02:42:58.334 [I] [server/service.go:237] frps tcp listen on 0.0.0.0:7000 2025-05-03 02:42:58.334 [I] [server/service.go:305] http service listen on 0.0.0.0:880 2025-05-03 02:42:58.334 [I] [server/service.go:319] https service listen on 0.0.0.0:8443 2025-05-03 02:42:58.334 [I] [frps/root.go:114] frps started successfully 2025-05-03 02:42:58.334 [I] [server/service.go:351] dashboard listen on 0.0.0.0:7500 2025-05-03 02:42:59.446 [I] [server/service.go:582] [a5cc564e487ae9fa] client login info: ip [136.331.243.134:3369] version [0.51.3] hostname [] os [linux] arch [arm64] 2025-05-03 02:42:59.475 [I] [proxy/tcp.go:82] [a5cc564e487ae9fa] [TCP] tcp proxy listen port [3080] 2025-05-03 02:42:59.475 [I] [server/control.go:399] [a5cc564e487ae9fa] new proxy [TCP] type [tcp] success 2025-05-03 02:42:59.475 [I] [proxy/http.go:111] [a5cc564e487ae9fa] [PC] http proxy listen for host [hk.gsdef.com] location [] group [], routeByHTTPUser [] 2025-05-03 02:42:59.475 [I] [server/control.go:399] [a5cc564e487ae9fa] new proxy [PC] type [http] success 2025-05-03 02:43:46.883 [I] [proxy/proxy.go:115] [a5cc564e487ae9fa] [TCP] proxy closing 2025-05-03 02:43:46.883 [W] [proxy/proxy.go:201] [a5cc564e487ae9fa] [TCP] listener is closed: accept tcp [::]:3080: use of closed network connection 2025-05-03 02:43:46.883 [I] [proxy/proxy.go:115] [a5cc564e487ae9fa] [PC] proxy closing ``` ``` 2025/05/03 02:25:02 [I] [root.go:220] start frpc service for config file [/var/etc/frp/frpc.conf] 2025/05/03 02:25:02 [I] [service.go:301] [b48a50f1b6a15544] login to server success, get run id [b48a50f1b6a15544] 2025/05/03 02:25:02 [I] [proxy_manager.go:150] [b48a50f1b6a15544] proxy added: [TCP PC] 2025/05/03 02:25:02 [I] [control.go:172] [b48a50f1b6a15544] [TCP] start proxy success 2025/05/03 02:25:02 [I] [control.go:172] [b48a50f1b6a15544] [PC] start proxy success ``` ### Steps to reproduce OpenWRT Docs 感觉不太完整 找问题太费劲了
Author
Owner

@Lioncky commented on GitHub (May 3, 2025):

都配置好了 没啥问题 说的就是个小bug 感谢项目组

<!-- gh-comment-id:2848558831 --> @Lioncky commented on GitHub (May 3, 2025): 都配置好了 没啥问题 说的就是个小bug 感谢项目组
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#3772
No description provided.