mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #3495] Frpc 支持server_addr domain吗? #2793
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#2793
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @commandoccz on GitHub (Jun 26, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3495
Bug Description
由于frp支持websocket,我就想将frps放在nginx后端,由nginx反代websocket到frps,出于安全考虑我在VPS上禁止了ip直接访问,因此frpc的server_addr 需要用到域名
frps.ini:
[common]
bind_addr = 0.0.0.0
bind_port = 7000
kcp_bind_port = 7000
dashboard_addr = 0.0.0.0
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin
frpc.ini:
[common]
server_addr = https://frpsocket-original.engineer.online
server_port = 443
protocol = websocket
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
frpc -c ./frpc.ini运行后报错:
[W] [service.go:131] login to server failed: dial tcp: lookup https://frpsocket-original.engineer.online: no such host dial tcp: lookup https://frpsocket-original.engineer.online: no such hostfrpc Version
0.49.0
frps Version
0.49.0
System Architecture
Server:"Ubuntu ARM64";Client:"Win10_64bit/Ubuntu amd64"
Configurations
Reference to Bug Description
Logs
Server log:

其中:
2023/06/25 20:26:42 [D] [service.go:474] Accept new mux stream error: invalid protocol version
2023/06/25 20:26:42 [D] [service.go:474] Accept new mux stream error: invalid protocol version
2023/06/25 20:26:44 [D] [service.go:474] Accept new mux stream error: invalid protocol version
是我用浏览器访问的服务器响应,说明nginx已经转发了websocket
Client Log:
[W] [service.go:131] login to server failed: dial tcp: lookup https://frpsocket-original.engineer.online: no such host
dial tcp: lookup https://frpsocket-original.engineer.online: no such host
Steps to reproduce
Reference to Bug Description
Affected area
@fatedier commented on GitHub (Jun 26, 2023):
server_addrdoes not need to include the protocol type.@commandoccz commented on GitHub (Jun 26, 2023):
T_T Still not working.......
frpc.ini:
[common]
server_addr = frpsocket-original.engineer.online
server_port = 443
protocol = websocket
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
root@instance-20220601-1259:~/frp# ./frpc -c ./frpc.ini
2023/06/26 10:49:52 [W] [service.go:131] login to server failed: bad status
bad status
root@instance-20220601-1259:~/frp# telnet frpsocket-original.engineer.online 443
Trying 138.18.32.239...
Connected to frpsocket-original.engineer.online.
Escape character is '^]'.
sss
HTTP/1.1 400 Bad Request
Server: nginx
Date: Mon, 26 Jun 2023 02:50:50 GMT
Content-Type: text/html
@commandoccz commented on GitHub (Jun 26, 2023):
It doesn't matter, as long as the server_addr supports domain name access and the format server_addr = xxx.com/xxx/ is correct, the rest is a network problem. I will troubleshoot step by step and then share the results.
@commandoccz commented on GitHub (Jun 26, 2023):
nginx reverse_proxy conf:
#PROXY-START/
proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions;
proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version;
location /
{
proxy_pass http://localhost:7000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
client_max_body_size 0;
proxy_ssl_verify off;
proxy_http_version 1.1;
}
#PROXY-END/
nginx logfile:
221.234.213.176 - - - - - [26/Jun/2023:12:07:53 +0800] "GET / HTTP/2.0" 502 502"-" "curl/7.68.0" "-"221.234.213.176 - - - - - [26/Jun/2023:12:08:48 +0800] "GET /~!frp HTTP/1.1" 302 -"-" "-" "-"221.234.213.176 - - - - - [26/Jun/2023:12:14:30 +0800] "GET /~!frp HTTP/1.1" 302 -"-" "-" "-"221.234.213.176 - - - - - [26/Jun/2023:12:21:19 +0800] "GET /~!frp HTTP/1.1" 302 -"-" "-" "-"221.234.213.176 - - - - - [26/Jun/2023:12:23:12 +0800] "GET /~!frp HTTP/1.1" 302 -"-" "-" "-"@commandoccz commented on GitHub (Jun 26, 2023):
Browser access:https://frpsocket-original.engineer.online/~!frp
response:
“not websocket protocol”
@commandoccz commented on GitHub (Jun 26, 2023):
I feel this is a Domain Fronting issue.
https://xz.aliyun.com/t/11460
@xqzr commented on GitHub (Jun 27, 2023):
Try v0.50.0
@commandoccz commented on GitHub (Jul 5, 2023):
使用websocket在线调试工具,后台能收到请求,因为调试工具没有TLS所以被拒绝,使用frpc客户端连接,依然直接报错,服务器端无任何反应

@github-actions[bot] commented on GitHub (Aug 5, 2023):
Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.