[GH-ISSUE #4234] 'localAddr' of https2http seems not working. #3335

Closed
opened 2026-05-05 14:09:06 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @playercatboy on GitHub (May 23, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4234

Bug Description

When using frpc and frps version 0.58.0, using https2http plugin to proxy LAN HTTP service to Internet, frpc seems not working.

The output log shows it dials TCP 127.0.0.1:0 instead of 127.0.0.1:3000, which is abnormal.

I checked netstat -lntp, shows the following output:

[root@abc frpc]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1248/sshd: /usr/sbi 
tcp        0      0 0.0.0.0:3000            0.0.0.0:*               LISTEN      253334/docker-proxy 
tcp        0      0 0.0.0.0:8989            0.0.0.0:*               LISTEN      2312/docker-proxy   
tcp        0      0 0.0.0.0:2222            0.0.0.0:*               LISTEN      253353/docker-proxy 
tcp        0      0 0.0.0.0:5230            0.0.0.0:*               LISTEN      2294/docker-proxy   
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1011/rpcbind        
tcp        0      0 0.0.0.0:2224            0.0.0.0:*               LISTEN      2334/docker-proxy   
tcp        0      0 0.0.0.0:8081            0.0.0.0:*               LISTEN      2272/docker-proxy   
tcp6       0      0 :::22                   :::*                    LISTEN      1248/sshd: /usr/sbi 
tcp6       0      0 :::3000                 :::*                    LISTEN      253341/docker-proxy 
tcp6       0      0 :::8989                 :::*                    LISTEN      2321/docker-proxy   
tcp6       0      0 :::2222                 :::*                    LISTEN      253360/docker-proxy 
tcp6       0      0 :::5230                 :::*                    LISTEN      2304/docker-proxy   
tcp6       0      0 :::111                  :::*                    LISTEN      1011/rpcbind        
tcp6       0      0 :::2224                 :::*                    LISTEN      2340/docker-proxy   
tcp6       0      0 :::8081                 :::*                    LISTEN      2279/docker-proxy

Which indicates the TCP port 3000 is open.

frpc Version

0.58.0

frps Version

0.58.0

System Architecture

linux/arm64

Configurations

frps.toml

bindAddr = "0.0.0.0"
bindPort = 7000

vhostHTTPPort = 8080
vhostHTTPSPort = 8443

subDomainHost = "domain.ext"

auth.method = "token"
auth.token = "12345678"

frpc.toml

user = "abc"

serverAddr = "xxx.xxx.xxx.xxx"
serverPort = 7000

auth.method = "token"
auth.token = "12345678"


[[proxies]]
name = "gitea-ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 2222
remotePort = 2222


[[proxies]]
name = "gitea-https"
type = "https"
subdomain = "git"
[proxies.plugin]
name = "https2http"
localAddr = "127.0.0.1:3000"
crtPath = "domain.pem"
keyPath = "domain.key"
hostHeaderRewrite = "127.0.0.1"
requestHeaders.set.x-from-where = "frp"

Logs

2024-05-23 12:11:35.690 [I] [sub/root.go:142] start frpc service for config file [frpc.toml]
2024-05-23 12:11:35.690 [I] [client/service.go:294] try to connect to server...
2024-05-23 12:11:35.774 [I] [client/service.go:286] [df40e7da7806f48e] login to server success, get run id [df40e7da7806f48e]
2024-05-23 12:11:35.774 [I] [proxy/proxy_manager.go:173] [df40e7da7806f48e] proxy added: [abc.gitea-ssh abc.gitea-https]
2024-05-23 12:11:35.805 [I] [client/control.go:168] [df40e7da7806f48e] [abc.gitea-https] start proxy success
2024-05-23 12:11:35.806 [I] [client/control.go:168] [df40e7da7806f48e] [abc.gitea-ssh] start proxy success
2024-05-23 12:11:49.541 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused
2024-05-23 12:11:49.665 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused
2024-05-23 12:11:50.527 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused
2024-05-23 12:11:50.655 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused
2024-05-23 12:11:56.531 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused
2024-05-23 12:11:57.524 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused
2024-05-23 12:11:58.246 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused
2024-05-23 12:11:59.229 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused

Steps to reproduce

  1. Set *.domain.ext A record to IP Address xxx.xxx.xxx.xxx.
  2. Use above configuration file and version 0.58.0 arm64 binaries.
  3. Start frps -c frps.toml
  4. Start frpc -c frpc.toml
  5. Use browser to navigate to https://git.domain.ext:8443
    ...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @playercatboy on GitHub (May 23, 2024). Original GitHub issue: https://github.com/fatedier/frp/issues/4234 ### Bug Description When using `frpc` and `frps` version 0.58.0, using `https2http` plugin to proxy LAN HTTP service to Internet, frpc seems not working. The output log shows it dials TCP `127.0.0.1:0` instead of `127.0.0.1:3000`, which is abnormal. I checked `netstat -lntp`, shows the following output: ``` [root@abc frpc]# netstat -lntp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1248/sshd: /usr/sbi tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 253334/docker-proxy tcp 0 0 0.0.0.0:8989 0.0.0.0:* LISTEN 2312/docker-proxy tcp 0 0 0.0.0.0:2222 0.0.0.0:* LISTEN 253353/docker-proxy tcp 0 0 0.0.0.0:5230 0.0.0.0:* LISTEN 2294/docker-proxy tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1011/rpcbind tcp 0 0 0.0.0.0:2224 0.0.0.0:* LISTEN 2334/docker-proxy tcp 0 0 0.0.0.0:8081 0.0.0.0:* LISTEN 2272/docker-proxy tcp6 0 0 :::22 :::* LISTEN 1248/sshd: /usr/sbi tcp6 0 0 :::3000 :::* LISTEN 253341/docker-proxy tcp6 0 0 :::8989 :::* LISTEN 2321/docker-proxy tcp6 0 0 :::2222 :::* LISTEN 253360/docker-proxy tcp6 0 0 :::5230 :::* LISTEN 2304/docker-proxy tcp6 0 0 :::111 :::* LISTEN 1011/rpcbind tcp6 0 0 :::2224 :::* LISTEN 2340/docker-proxy tcp6 0 0 :::8081 :::* LISTEN 2279/docker-proxy ``` Which indicates the TCP port 3000 is open. ### frpc Version 0.58.0 ### frps Version 0.58.0 ### System Architecture linux/arm64 ### Configurations frps.toml ```toml bindAddr = "0.0.0.0" bindPort = 7000 vhostHTTPPort = 8080 vhostHTTPSPort = 8443 subDomainHost = "domain.ext" auth.method = "token" auth.token = "12345678" ``` frpc.toml ```toml user = "abc" serverAddr = "xxx.xxx.xxx.xxx" serverPort = 7000 auth.method = "token" auth.token = "12345678" [[proxies]] name = "gitea-ssh" type = "tcp" localIP = "127.0.0.1" localPort = 2222 remotePort = 2222 [[proxies]] name = "gitea-https" type = "https" subdomain = "git" [proxies.plugin] name = "https2http" localAddr = "127.0.0.1:3000" crtPath = "domain.pem" keyPath = "domain.key" hostHeaderRewrite = "127.0.0.1" requestHeaders.set.x-from-where = "frp" ``` ### Logs ``` 2024-05-23 12:11:35.690 [I] [sub/root.go:142] start frpc service for config file [frpc.toml] 2024-05-23 12:11:35.690 [I] [client/service.go:294] try to connect to server... 2024-05-23 12:11:35.774 [I] [client/service.go:286] [df40e7da7806f48e] login to server success, get run id [df40e7da7806f48e] 2024-05-23 12:11:35.774 [I] [proxy/proxy_manager.go:173] [df40e7da7806f48e] proxy added: [abc.gitea-ssh abc.gitea-https] 2024-05-23 12:11:35.805 [I] [client/control.go:168] [df40e7da7806f48e] [abc.gitea-https] start proxy success 2024-05-23 12:11:35.806 [I] [client/control.go:168] [df40e7da7806f48e] [abc.gitea-ssh] start proxy success 2024-05-23 12:11:49.541 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused 2024-05-23 12:11:49.665 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused 2024-05-23 12:11:50.527 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused 2024-05-23 12:11:50.655 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused 2024-05-23 12:11:56.531 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused 2024-05-23 12:11:57.524 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused 2024-05-23 12:11:58.246 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused 2024-05-23 12:11:59.229 [E] [proxy/proxy.go:206] [df40e7da7806f48e] [abc.gitea-https] connect to local service [127.0.0.1:0] error: dial tcp 127.0.0.1:0: connect: connection refused ``` ### Steps to reproduce 1. Set `*.domain.ext` A record to IP Address `xxx.xxx.xxx.xxx`. 2. Use above configuration file and version 0.58.0 arm64 binaries. 3. Start `frps -c frps.toml` 4. Start `frpc -c frpc.toml` 5. Use browser to navigate to `https://git.domain.ext:8443` ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [X] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@fatedier commented on GitHub (May 23, 2024):

https://github.com/fatedier/frp?tab=readme-ov-file#client-plugins
参考文档,声明 plugin 类型是 type ,不是 name,下个版本这样的配置会直接报错而不是允许运行。

<!-- gh-comment-id:2126230727 --> @fatedier commented on GitHub (May 23, 2024): https://github.com/fatedier/frp?tab=readme-ov-file#client-plugins 参考文档,声明 plugin 类型是 type ,不是 name,下个版本这样的配置会直接报错而不是允许运行。
Author
Owner

@playercatboy commented on GitHub (May 23, 2024):

Thanks a lot!

<!-- gh-comment-id:2126288513 --> @playercatboy commented on GitHub (May 23, 2024): Thanks a lot!
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#3335
No description provided.