[GH-ISSUE #3008] 同样的环境下,客户端http_proxy插件无法正常工作,socks5插件可以正常工作 #2406

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

Originally created by @Weltolk on GitHub (Jul 7, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/3008

Bug Description

frps和frpc运行在同一台服务器上,该服务器是arm64云服务器,安全组已放行进网和出网的所有端口

本地是国内Windows 10 21H2 x64,Proxifier v4.07 x64,测试过其他http,https和socks5代理,都可以正常连接

客户端启用http_proxy插件后,通过Proxifier添加http或https代理,然后测试连接,显示可以连接frp,但是无法通过http_proxy访问任何ip(比如www.google.com:80),也无法访问frpc所在的服务器的本地ip(Windows上Proxifier代理本地的127.0.0.1到frpc的http_proxy,再访问127.0.0.1:frpc上运行的nginx的端口,也是无法访问),http代理和https代理都是一样的结果

Proxifier的报错信息:

https代理:

[49:33] Testing Started.
	Proxy Server
	Address:	xxx.xxx.xxx.xxx:7777
	Protocol:	HTTPS
	Authentication: Basic
	Username:	aaaa

[49:33] Starting: Test 1: Connection to the Proxy Server
[49:33] IP Address: xxx.xxx.xxx.xxx
[49:33] Connection established
[49:33] Test passed.
[49:33] Starting: Test 2: Connection through the Proxy Server
[49:33] Error : connection to the proxy server was closed unexpectedly.
	Please make sure that the proxy server protocol and address are correct.
[49:33] Test failed.
[49:33] Testing Finished.

http代理:

[49:42] Testing Started.
	Proxy Server
	Address:	xxx.xxx.xxx.xxx:7777
	Protocol:	HTTP
	Authentication: Basic
	Username:	aaaa

[49:42] Starting: Test 1: Connection to the Proxy Server
[49:42] IP Address: xxx.xxx.xxx.xxx
[49:42] Connection established
[49:42] Test passed.
[49:42] Starting: Test 2: Connection through the Proxy Server
[49:42] Connection to www.google.com:80 established through the proxy server.
[49:42] Error : connection to the proxy server was closed unexpectedly.
	Please make sure that the target host is a Web Server.
	The error may also indicate that the proxy server is not operating properly.
[49:42] Test failed.
[49:42] Testing Finished.

同一个服务端,客户端和本地环境,使用socks5插件可以正常连接

socks5代理:

[51:06] Testing Started.
	Proxy Server
	Address:	xxx.xxx.xxx.xxx:6666
	Protocol:	SOCKS 5
	Authentication: YES
	Username:	aaaa

[51:06] Starting: Test 1: Connection to the Proxy Server
[51:06] IP Address: xxx.xxx.xxx.xxx
[51:06] Connection established
[51:06] Test passed.
[51:06] Starting: Test 2: Connection through the Proxy Server
[51:06] Authentication was successful.
[51:06] Connection to www.google.com:80 established through the proxy server.
[51:07] A default web page was successfuly loaded.
[51:07] Test passed.
[51:07] Starting: Test 3: Proxy Server latency
[51:08] Latency = 169 ms
[51:08] Test passed.
[51:08] Testing Finished.

frpc Version

0.42.0

frps Version

0.42.0

System Architecture

Linux version 5.13.0-1021-oracle (buildd@bos02-arm64-014) (gcc (Ubuntu 9.4.0-1ubuntu120.04) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #2620.04.1-Ubuntu SMP Mon Mar 7 14:30:17 UTC 2022

Configurations

frps.ini:

[common]
bind_port = 5555
kcp_bind_port = 5555
detailed_errors_to_client = false
authentication_method = token
authenticate_heartbeats = true
authenticate_new_work_conns = true
token = xxxx
allow_ports = 6666,7777
max_pool_count = 15
max_ports_per_client = 3
log_max_days = 30
log_file = console
log_level = trace
tls_only = true
tls_cert_file = /root/frp/cert_local/server.crt
tls_key_file = /root/frp/cert_local/server.key
tls_trusted_ca_file = /root/frp/cert_local/ca.crt

frpc.ini:

[common]
server_addr = 127.0.0.1
server_port = 5555
protocol = kcp
log_file = console
log_level = trace
log_max_days = 30
pool_count = 15
authentication_method = token
authenticate_heartbeats = true
authenticate_new_work_conns = true
token = xxxx
use_compression = false
tls_enable = true
tls_cert_file = /root/frp/cert_local/client.crt
tls_key_file = /root/frp/cert_local/client.key
tls_trusted_ca_file = /root/frp/cert_local/ca.crt

[socks5]
type = tcp
remote_port = 6666
plugin = socks5
plugin_user = aaaa
plugin_passwd = bbbb

[http_proxy]
type = tcp
remote_port = 7777
plugin = http_proxy
plugin_http_user = aaaa
plugin_http_passwd = bbbb

Logs

因为frps和frpc的配置文件里将log_file设为了console,所以是标准输出:

frps的log:

2022/07/07 16:45:04 [I] [root.go:200] frps uses config file: frps.ini
2022/07/07 16:45:04 [I] [service.go:194] frps tcp listen on 0.0.0.0:5555
2022/07/07 16:45:04 [I] [service.go:204] frps kcp listen on udp 0.0.0.0:5555
2022/07/07 16:45:04 [I] [root.go:209] frps started successfully
2022/07/07 16:45:09 [T] [service.go:396] start check TLS connection...
2022/07/07 16:45:09 [T] [service.go:405] check TLS connection success, isTLS: true custom: true
2022/07/07 16:45:09 [I] [service.go:450] [2b846489d31f9339] client login info: ip [127.0.0.1:52398] version [0.42.0] hostname [] os [linux] arch [arm64]
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [I] [tcp.go:64] [2b846489d31f9339] [http_proxy] tcp proxy listen port [7777]
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered
2022/07/07 16:45:09 [I] [control.go:465] [2b846489d31f9339] new proxy [http_proxy] success
2022/07/07 16:45:09 [I] [tcp.go:64] [2b846489d31f9339] [socks5] tcp proxy listen port [6666]
2022/07/07 16:45:09 [I] [control.go:465] [2b846489d31f9339] new proxy [socks5] success
2022/07/07 16:45:39 [D] [control.go:494] [2b846489d31f9339] receive heartbeat
2022/07/07 16:45:48 [I] [proxy.go:179] [2b846489d31f9339] [http_proxy] get a user connection [xxx.xxx.xxx.xxx:1183]
2022/07/07 16:45:48 [D] [control.go:248] [2b846489d31f9339] get work connection from pool
2022/07/07 16:45:48 [D] [proxy.go:104] [2b846489d31f9339] [http_proxy] get a new work connection: [127.0.0.1:52398]
2022/07/07 16:45:48 [T] [proxy.go:279] [2b846489d31f9339] [http_proxy] handler user tcp connection, use_encryption: false, use_compression: false
2022/07/07 16:45:48 [D] [proxy.go:290] [2b846489d31f9339] [http_proxy] join connections, workConn(l[[::]:5555] r[127.0.0.1:52398]) userConn(l[10.0.0.75:7777] r[xxx.xxx.xxx.xxx:1183])
2022/07/07 16:45:48 [D] [proxy.go:300] [2b846489d31f9339] [http_proxy] join connections closed
2022/07/07 16:45:48 [D] [control.go:219] [2b846489d31f9339] new work connection registered

frpc的log:

2022/07/07 16:45:09 [T] [root.go:211] start frpc service for config file [frpc.ini]
2022/07/07 16:45:09 [I] [service.go:349] [2b846489d31f9339] login to server success, get run id [2b846489d31f9339], server udp port [0]
2022/07/07 16:45:09 [I] [proxy_manager.go:144] [2b846489d31f9339] proxy added: [socks5 http_proxy]
2022/07/07 16:45:09 [T] [proxy_wrapper.go:171] [2b846489d31f9339] [http_proxy] change status from [new] to [wait start]
2022/07/07 16:45:09 [T] [proxy_wrapper.go:171] [2b846489d31f9339] [socks5] change status from [new] to [wait start]
2022/07/07 16:45:09 [I] [control.go:181] [2b846489d31f9339] [http_proxy] start proxy success
2022/07/07 16:45:09 [I] [control.go:181] [2b846489d31f9339] [socks5] start proxy success
2022/07/07 16:45:39 [D] [control.go:360] [2b846489d31f9339] send heartbeat to server
2022/07/07 16:45:39 [D] [control.go:391] [2b846489d31f9339] receive heartbeat from server
2022/07/07 16:45:48 [D] [proxy_wrapper.go:231] [2b846489d31f9339] [http_proxy] start a new work connection, localAddr: 0.0.0.0:52398 remoteAddr: 127.0.0.1:5555
2022/07/07 16:45:48 [T] [proxy.go:735] [2b846489d31f9339] [http_proxy] handle tcp work connection, use_encryption: false, use_compression: false
2022/07/07 16:45:48 [D] [proxy.go:784] [2b846489d31f9339] [http_proxy] handle by plugin: http_proxy
2022/07/07 16:45:48 [D] [proxy.go:786] [2b846489d31f9339] [http_proxy] handle by plugin finished
2022/07/07 16:46:09 [D] [control.go:360] [2b846489d31f9339] send heartbeat to server
2022/07/07 16:46:09 [D] [control.go:391] [2b846489d31f9339] receive heartbeat from server
2022/07/07 16:46:39 [D] [control.go:360] [2b846489d31f9339] send heartbeat to server
2022/07/07 16:46:39 [D] [control.go:391] [2b846489d31f9339] receive heartbeat from server

Steps to reproduce

  1. ./frps -c frps.ini
  2. ./frpc -c frpc.ini
  3. 本地Windows运行Proxifier,添加http和https代理服务器,依次测试连接到www.google.com:80和frpc所在服务器的本地ip

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @Weltolk on GitHub (Jul 7, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/3008 ### Bug Description frps和frpc运行在同一台服务器上,该服务器是arm64云服务器,安全组已放行进网和出网的所有端口 本地是国内Windows 10 21H2 x64,Proxifier v4.07 x64,测试过其他http,https和socks5代理,都可以正常连接 客户端启用http_proxy插件后,通过Proxifier添加http或https代理,然后测试连接,显示可以连接frp,但是无法通过http_proxy访问任何ip(比如www.google.com:80),也无法访问frpc所在的服务器的本地ip(Windows上Proxifier代理本地的127.0.0.1到frpc的http_proxy,再访问127.0.0.1:frpc上运行的nginx的端口,也是无法访问),http代理和https代理都是一样的结果 ## Proxifier的报错信息: ### https代理: ```log [49:33] Testing Started. Proxy Server Address: xxx.xxx.xxx.xxx:7777 Protocol: HTTPS Authentication: Basic Username: aaaa [49:33] Starting: Test 1: Connection to the Proxy Server [49:33] IP Address: xxx.xxx.xxx.xxx [49:33] Connection established [49:33] Test passed. [49:33] Starting: Test 2: Connection through the Proxy Server [49:33] Error : connection to the proxy server was closed unexpectedly. Please make sure that the proxy server protocol and address are correct. [49:33] Test failed. [49:33] Testing Finished. ``` ### http代理: ```log [49:42] Testing Started. Proxy Server Address: xxx.xxx.xxx.xxx:7777 Protocol: HTTP Authentication: Basic Username: aaaa [49:42] Starting: Test 1: Connection to the Proxy Server [49:42] IP Address: xxx.xxx.xxx.xxx [49:42] Connection established [49:42] Test passed. [49:42] Starting: Test 2: Connection through the Proxy Server [49:42] Connection to www.google.com:80 established through the proxy server. [49:42] Error : connection to the proxy server was closed unexpectedly. Please make sure that the target host is a Web Server. The error may also indicate that the proxy server is not operating properly. [49:42] Test failed. [49:42] Testing Finished. ``` ## 同一个服务端,客户端和本地环境,使用socks5插件可以正常连接 ### socks5代理: ```log [51:06] Testing Started. Proxy Server Address: xxx.xxx.xxx.xxx:6666 Protocol: SOCKS 5 Authentication: YES Username: aaaa [51:06] Starting: Test 1: Connection to the Proxy Server [51:06] IP Address: xxx.xxx.xxx.xxx [51:06] Connection established [51:06] Test passed. [51:06] Starting: Test 2: Connection through the Proxy Server [51:06] Authentication was successful. [51:06] Connection to www.google.com:80 established through the proxy server. [51:07] A default web page was successfuly loaded. [51:07] Test passed. [51:07] Starting: Test 3: Proxy Server latency [51:08] Latency = 169 ms [51:08] Test passed. [51:08] Testing Finished. ``` ### frpc Version 0.42.0 ### frps Version 0.42.0 ### System Architecture Linux version 5.13.0-1021-oracle (buildd@bos02-arm64-014) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #26~20.04.1-Ubuntu SMP Mon Mar 7 14:30:17 UTC 2022 ### Configurations ## frps.ini: ```ini [common] bind_port = 5555 kcp_bind_port = 5555 detailed_errors_to_client = false authentication_method = token authenticate_heartbeats = true authenticate_new_work_conns = true token = xxxx allow_ports = 6666,7777 max_pool_count = 15 max_ports_per_client = 3 log_max_days = 30 log_file = console log_level = trace tls_only = true tls_cert_file = /root/frp/cert_local/server.crt tls_key_file = /root/frp/cert_local/server.key tls_trusted_ca_file = /root/frp/cert_local/ca.crt ``` ## frpc.ini: ```ini [common] server_addr = 127.0.0.1 server_port = 5555 protocol = kcp log_file = console log_level = trace log_max_days = 30 pool_count = 15 authentication_method = token authenticate_heartbeats = true authenticate_new_work_conns = true token = xxxx use_compression = false tls_enable = true tls_cert_file = /root/frp/cert_local/client.crt tls_key_file = /root/frp/cert_local/client.key tls_trusted_ca_file = /root/frp/cert_local/ca.crt [socks5] type = tcp remote_port = 6666 plugin = socks5 plugin_user = aaaa plugin_passwd = bbbb [http_proxy] type = tcp remote_port = 7777 plugin = http_proxy plugin_http_user = aaaa plugin_http_passwd = bbbb ``` ### Logs 因为frps和frpc的配置文件里将`log_file`设为了`console`,所以是标准输出: ## frps的log: ```shell 2022/07/07 16:45:04 [I] [root.go:200] frps uses config file: frps.ini 2022/07/07 16:45:04 [I] [service.go:194] frps tcp listen on 0.0.0.0:5555 2022/07/07 16:45:04 [I] [service.go:204] frps kcp listen on udp 0.0.0.0:5555 2022/07/07 16:45:04 [I] [root.go:209] frps started successfully 2022/07/07 16:45:09 [T] [service.go:396] start check TLS connection... 2022/07/07 16:45:09 [T] [service.go:405] check TLS connection success, isTLS: true custom: true 2022/07/07 16:45:09 [I] [service.go:450] [2b846489d31f9339] client login info: ip [127.0.0.1:52398] version [0.42.0] hostname [] os [linux] arch [arm64] 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [I] [tcp.go:64] [2b846489d31f9339] [http_proxy] tcp proxy listen port [7777] 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [D] [control.go:219] [2b846489d31f9339] new work connection registered 2022/07/07 16:45:09 [I] [control.go:465] [2b846489d31f9339] new proxy [http_proxy] success 2022/07/07 16:45:09 [I] [tcp.go:64] [2b846489d31f9339] [socks5] tcp proxy listen port [6666] 2022/07/07 16:45:09 [I] [control.go:465] [2b846489d31f9339] new proxy [socks5] success 2022/07/07 16:45:39 [D] [control.go:494] [2b846489d31f9339] receive heartbeat 2022/07/07 16:45:48 [I] [proxy.go:179] [2b846489d31f9339] [http_proxy] get a user connection [xxx.xxx.xxx.xxx:1183] 2022/07/07 16:45:48 [D] [control.go:248] [2b846489d31f9339] get work connection from pool 2022/07/07 16:45:48 [D] [proxy.go:104] [2b846489d31f9339] [http_proxy] get a new work connection: [127.0.0.1:52398] 2022/07/07 16:45:48 [T] [proxy.go:279] [2b846489d31f9339] [http_proxy] handler user tcp connection, use_encryption: false, use_compression: false 2022/07/07 16:45:48 [D] [proxy.go:290] [2b846489d31f9339] [http_proxy] join connections, workConn(l[[::]:5555] r[127.0.0.1:52398]) userConn(l[10.0.0.75:7777] r[xxx.xxx.xxx.xxx:1183]) 2022/07/07 16:45:48 [D] [proxy.go:300] [2b846489d31f9339] [http_proxy] join connections closed 2022/07/07 16:45:48 [D] [control.go:219] [2b846489d31f9339] new work connection registered ``` ## frpc的log: ```shell 2022/07/07 16:45:09 [T] [root.go:211] start frpc service for config file [frpc.ini] 2022/07/07 16:45:09 [I] [service.go:349] [2b846489d31f9339] login to server success, get run id [2b846489d31f9339], server udp port [0] 2022/07/07 16:45:09 [I] [proxy_manager.go:144] [2b846489d31f9339] proxy added: [socks5 http_proxy] 2022/07/07 16:45:09 [T] [proxy_wrapper.go:171] [2b846489d31f9339] [http_proxy] change status from [new] to [wait start] 2022/07/07 16:45:09 [T] [proxy_wrapper.go:171] [2b846489d31f9339] [socks5] change status from [new] to [wait start] 2022/07/07 16:45:09 [I] [control.go:181] [2b846489d31f9339] [http_proxy] start proxy success 2022/07/07 16:45:09 [I] [control.go:181] [2b846489d31f9339] [socks5] start proxy success 2022/07/07 16:45:39 [D] [control.go:360] [2b846489d31f9339] send heartbeat to server 2022/07/07 16:45:39 [D] [control.go:391] [2b846489d31f9339] receive heartbeat from server 2022/07/07 16:45:48 [D] [proxy_wrapper.go:231] [2b846489d31f9339] [http_proxy] start a new work connection, localAddr: 0.0.0.0:52398 remoteAddr: 127.0.0.1:5555 2022/07/07 16:45:48 [T] [proxy.go:735] [2b846489d31f9339] [http_proxy] handle tcp work connection, use_encryption: false, use_compression: false 2022/07/07 16:45:48 [D] [proxy.go:784] [2b846489d31f9339] [http_proxy] handle by plugin: http_proxy 2022/07/07 16:45:48 [D] [proxy.go:786] [2b846489d31f9339] [http_proxy] handle by plugin finished 2022/07/07 16:46:09 [D] [control.go:360] [2b846489d31f9339] send heartbeat to server 2022/07/07 16:46:09 [D] [control.go:391] [2b846489d31f9339] receive heartbeat from server 2022/07/07 16:46:39 [D] [control.go:360] [2b846489d31f9339] send heartbeat to server 2022/07/07 16:46:39 [D] [control.go:391] [2b846489d31f9339] receive heartbeat from server ``` ### Steps to reproduce 1. `./frps -c frps.ini` 2. `./frpc -c frpc.ini` 3. 本地Windows运行Proxifier,添加http和https代理服务器,依次测试连接到www.google.com:80和frpc所在服务器的本地ip ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [X] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:32:53 -06:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 7, 2022):

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1207304876 --> @github-actions[bot] commented on GitHub (Aug 7, 2022): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
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#2406
No description provided.