[GH-ISSUE #1030] xtcp连接失败 #816

Closed
opened 2026-05-05 12:31:12 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @JaydenFish on GitHub (Dec 31, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/1030

What version of frp are you using (./frpc -v or ./frps -v)?
0.22.0

What operating system and processor architecture are you using (go env)?
win10 x64

Configures you used:
服务器端

[common]
# A literal address or host name for IPv6 must be enclosed
# in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"
bind_addr = 0.0.0.0
bind_port = 7000

# udp port to help make udp hole to penetrate nat
bind_udp_port = 7001

# udp port used for kcp protocol, it can be same with 'bind_port'
# if not set, kcp is disabled in frps
kcp_bind_port = 7000

# specify which address proxy will listen for, default value is same with bind_addr
# proxy_bind_addr = 127.0.0.1

# if you want to support virtual host, you must set the http port for listening (optional)
# Note: http port and https port can be same with bind_port
vhost_http_port = 80
vhost_https_port = 443

# response header timeout(seconds) for vhost http server, default is 60s
# vhost_http_timeout = 60

# set dashboard_addr and dashboard_port to view dashboard of frps
# dashboard_addr's default value is same with bind_addr
# dashboard is available only if dashboard_port is set
dashboard_addr = 0.0.0.0
dashboard_port = 7500

# dashboard user and passwd for basic auth protect, if not set, both default value is admin
dashboard_user = admin
dashboard_pwd = admin

# dashboard assets directory(only for debug mode)
# assets_dir = ./static
# console or real logFile path like ./frps.log
log_file = ./frps.log

# trace, debug, info, warn, error
log_level = info

log_max_days = 3

# auth token
token = 12345678

# heartbeat configure, it's not recommended to modify the default value
# the default value of heartbeat_timeout is 90
# heartbeat_timeout = 90

# only allow frpc to bind ports you list, if you set nothing, there won't be any limit
# allow_ports = 2000-3000,3001,3003,4000-50000

# pool_count in each proxy will change to max_pool_count if they exceed the maximum value
max_pool_count = 5

# max ports can be used for each client, default value is 0 means no limit
max_ports_per_client = 0

# authentication_timeout means the timeout interval (seconds) when the frpc connects frps
# if authentication_timeout is zero, the time is not verified, default is 900s
authentication_timeout = 900

# if subdomain_host is not empty, you can set subdomain when type is http or https in frpc's configure file
# when subdomain is test, the host used by routing is test.frps.com
subdomain_host = frps.com

# if tcp stream multiplexing is used, default is true
tcp_mux = true

客户端1

[common]
# A literal address or host name for IPv6 must be enclosed
# in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"
server_addr = 139.196.90.112
server_port = 7000

# if you want to connect frps by http proxy or socks5 proxy, you can set http_proxy here or in global environment variables
# it only works when protocol is tcp
# http_proxy = http://user:passwd@192.168.1.128:8080
# http_proxy = socks5://user:passwd@192.168.1.128:1080

# console or real logFile path like ./frpc.log
log_file = ./frpc.log

# trace, debug, info, warn, error
log_level = info

log_max_days = 3

# for authentication
token = 12345678

# set admin address for control frpc's action by http api such as reload
admin_addr = 127.0.0.1
admin_port = 7400
admin_user = admin
admin_pwd = admin

# connections will be established in advance, default value is zero
pool_count = 5

# if tcp stream multiplexing is used, default is true, it must be same with frps
tcp_mux = true

# your proxy name will be changed to {user}.{proxy}
user = yjd-desktop

# decide if exit program when first login failed, otherwise continuous relogin to frps
# default is true
login_fail_exit = true

# communication protocol used to connect to server
# now it supports tcp and kcp and websocket, default is tcp
protocol = tcp

# specify a dns server, so frpc will use this instead of default one
# dns_server = 8.8.8.8

# proxy names you want to start divided by ','
# default is empty, means all proxies
# start = ssh,dns

# heartbeat configure, it's not recommended to modify the default value
# the default value of heartbeat_interval is 10 and heartbeat_timeout is 90
# heartbeat_interval = 30
# heartbeat_timeout = 90
[desktop_3389]
type = xtcp
# 只有 sk 一致的用户才能访问到此服务
sk = abcdefg
local_ip = 127.0.0.1
local_port = 3389
use_encryption = true
use_compression = true

[notebook_3389_visitor]
type = xtcp
# xtcp 的访问者
role = visitor
# 要访问的 xtcp 代理的名字
server_name = notebook_3389
sk = abcdefg
# 绑定本地端口,用于和server的端口建立通道
bind_addr = 127.0.0.1
bind_port = 15000
use_encryption = true
use_compression = true

客户端2

[common]
# A literal address or host name for IPv6 must be enclosed
# in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"
server_addr = 139.196.90.112
server_port = 7000

# if you want to connect frps by http proxy or socks5 proxy, you can set http_proxy here or in global environment variables
# it only works when protocol is tcp
# http_proxy = http://user:passwd@192.168.1.128:8080
# http_proxy = socks5://user:passwd@192.168.1.128:1080

# console or real logFile path like ./frpc.log
log_file = ./frpc.log

# trace, debug, info, warn, error
log_level = info

log_max_days = 3

# for authentication
token = 12345678

# set admin address for control frpc's action by http api such as reload
admin_addr = 127.0.0.1
admin_port = 7400
admin_user = admin
admin_pwd = admin

# connections will be established in advance, default value is zero
pool_count = 5

# if tcp stream multiplexing is used, default is true, it must be same with frps
tcp_mux = true

# your proxy name will be changed to {user}.{proxy}
user = yjd-notebook

# decide if exit program when first login failed, otherwise continuous relogin to frps
# default is true
login_fail_exit = true

# communication protocol used to connect to server
# now it supports tcp and kcp and websocket, default is tcp
protocol = tcp

# specify a dns server, so frpc will use this instead of default one
# dns_server = 8.8.8.8

# proxy names you want to start divided by ','
# default is empty, means all proxies
# start = ssh,dns

# heartbeat configure, it's not recommended to modify the default value
# the default value of heartbeat_interval is 10 and heartbeat_timeout is 90
# heartbeat_interval = 30
# heartbeat_timeout = 90
[notebook_3389]
type = xtcp
# 只有 sk 一致的用户才能访问到此服务
sk = abcdefg
local_ip = 127.0.0.1
local_port = 3389
use_encryption = true
use_compression = true

[desktop_3389_visitor]
type = xtcp
# xtcp 的访问者
role = visitor
# 要访问的 xtcp 代理的名字
server_name = desktop_3389
sk = abcdefg
# 绑定本地端口,用于和server的端口建立通道
bind_addr = 127.0.0.1
bind_port = 15000
use_encryption = true
use_compression = true

Steps to reproduce the issue:
用windows自带的远程连接,连接127.0.0.1:15000,一直显示"正在配置远程会话..."

Describe the results you received:
本地log:

2019/01/01 01:35:21 [I] [service.go:205] login to server success, get run id [fbb9188c3f6c2f25], server udp port [7001]
2019/01/01 01:35:21 [I] [visitor_manager.go:69] [yjd-desktop.notebook_3389_visitor] start visitor success
2019/01/01 01:35:21 [I] [visitor_manager.go:112] visitor added: [yjd-desktop.notebook_3389_visitor]
2019/01/01 01:35:21 [I] [proxy_manager.go:136] [fbb9188c3f6c2f25] proxy added: [yjd-desktop.desktop_3389]
2019/01/01 01:35:21 [I] [service.go:100] admin server listen on 127.0.0.1:7400
2019/01/01 01:35:21 [I] [control.go:143] [yjd-desktop.desktop_3389] start proxy success
2019/01/01 01:35:41 [W] [visitor.go:235] [yjd-desktop.notebook_3389_visitor] get natHoleRespMsg error: read udp 192.168.2.4:53667->139.196.90.112:7001: i/o timeout
2019/01/01 01:36:46 [W] [visitor.go:235] [yjd-desktop.notebook_3389_visitor] get natHoleRespMsg error: read udp 192.168.2.4:51997->139.196.90.112:7001: i/o timeout

服务器log:

2018/12/31 17:35:21 [I] [service.go:319] client login info: ip [58.33.142.190:31931] version [0.22.0] hostname [] os [windows] arch [amd64]
2018/12/31 17:35:21 [I] [control.go:335] [fbb9188c3f6c2f25] new proxy [yjd-desktop.desktop_3389] success
2018/12/31 17:36:01 [I] [control.go:220] [1262c3d020e00642] control writer is closing
2018/12/31 17:36:01 [I] [proxy.go:73] [1262c3d020e00642] [yjd-notebook.notebook_3389] proxy closing
2018/12/31 17:36:01 [I] [control.go:292] [1262c3d020e00642] client exit success
2018/12/31 17:36:07 [I] [service.go:319] client login info: ip [180.175.162.253:54430] version [0.22.0] hostname [] os [windows] arch [amd64]
2018/12/31 17:36:07 [I] [control.go:335] [586a920ba84595f8] new proxy [yjd-notebook.notebook_3389] success

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

Can you point out what caused this issue (optional)

Originally created by @JaydenFish on GitHub (Dec 31, 2018). Original GitHub issue: https://github.com/fatedier/frp/issues/1030 **What version of frp are you using (./frpc -v or ./frps -v)?** 0.22.0 **What operating system and processor architecture are you using (`go env`)?** win10 x64 **Configures you used:** 服务器端 ``` [common] # A literal address or host name for IPv6 must be enclosed # in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80" bind_addr = 0.0.0.0 bind_port = 7000 # udp port to help make udp hole to penetrate nat bind_udp_port = 7001 # udp port used for kcp protocol, it can be same with 'bind_port' # if not set, kcp is disabled in frps kcp_bind_port = 7000 # specify which address proxy will listen for, default value is same with bind_addr # proxy_bind_addr = 127.0.0.1 # if you want to support virtual host, you must set the http port for listening (optional) # Note: http port and https port can be same with bind_port vhost_http_port = 80 vhost_https_port = 443 # response header timeout(seconds) for vhost http server, default is 60s # vhost_http_timeout = 60 # set dashboard_addr and dashboard_port to view dashboard of frps # dashboard_addr's default value is same with bind_addr # dashboard is available only if dashboard_port is set dashboard_addr = 0.0.0.0 dashboard_port = 7500 # dashboard user and passwd for basic auth protect, if not set, both default value is admin dashboard_user = admin dashboard_pwd = admin # dashboard assets directory(only for debug mode) # assets_dir = ./static # console or real logFile path like ./frps.log log_file = ./frps.log # trace, debug, info, warn, error log_level = info log_max_days = 3 # auth token token = 12345678 # heartbeat configure, it's not recommended to modify the default value # the default value of heartbeat_timeout is 90 # heartbeat_timeout = 90 # only allow frpc to bind ports you list, if you set nothing, there won't be any limit # allow_ports = 2000-3000,3001,3003,4000-50000 # pool_count in each proxy will change to max_pool_count if they exceed the maximum value max_pool_count = 5 # max ports can be used for each client, default value is 0 means no limit max_ports_per_client = 0 # authentication_timeout means the timeout interval (seconds) when the frpc connects frps # if authentication_timeout is zero, the time is not verified, default is 900s authentication_timeout = 900 # if subdomain_host is not empty, you can set subdomain when type is http or https in frpc's configure file # when subdomain is test, the host used by routing is test.frps.com subdomain_host = frps.com # if tcp stream multiplexing is used, default is true tcp_mux = true ``` 客户端1 ``` [common] # A literal address or host name for IPv6 must be enclosed # in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80" server_addr = 139.196.90.112 server_port = 7000 # if you want to connect frps by http proxy or socks5 proxy, you can set http_proxy here or in global environment variables # it only works when protocol is tcp # http_proxy = http://user:passwd@192.168.1.128:8080 # http_proxy = socks5://user:passwd@192.168.1.128:1080 # console or real logFile path like ./frpc.log log_file = ./frpc.log # trace, debug, info, warn, error log_level = info log_max_days = 3 # for authentication token = 12345678 # set admin address for control frpc's action by http api such as reload admin_addr = 127.0.0.1 admin_port = 7400 admin_user = admin admin_pwd = admin # connections will be established in advance, default value is zero pool_count = 5 # if tcp stream multiplexing is used, default is true, it must be same with frps tcp_mux = true # your proxy name will be changed to {user}.{proxy} user = yjd-desktop # decide if exit program when first login failed, otherwise continuous relogin to frps # default is true login_fail_exit = true # communication protocol used to connect to server # now it supports tcp and kcp and websocket, default is tcp protocol = tcp # specify a dns server, so frpc will use this instead of default one # dns_server = 8.8.8.8 # proxy names you want to start divided by ',' # default is empty, means all proxies # start = ssh,dns # heartbeat configure, it's not recommended to modify the default value # the default value of heartbeat_interval is 10 and heartbeat_timeout is 90 # heartbeat_interval = 30 # heartbeat_timeout = 90 [desktop_3389] type = xtcp # 只有 sk 一致的用户才能访问到此服务 sk = abcdefg local_ip = 127.0.0.1 local_port = 3389 use_encryption = true use_compression = true [notebook_3389_visitor] type = xtcp # xtcp 的访问者 role = visitor # 要访问的 xtcp 代理的名字 server_name = notebook_3389 sk = abcdefg # 绑定本地端口,用于和server的端口建立通道 bind_addr = 127.0.0.1 bind_port = 15000 use_encryption = true use_compression = true ``` 客户端2 ``` [common] # A literal address or host name for IPv6 must be enclosed # in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80" server_addr = 139.196.90.112 server_port = 7000 # if you want to connect frps by http proxy or socks5 proxy, you can set http_proxy here or in global environment variables # it only works when protocol is tcp # http_proxy = http://user:passwd@192.168.1.128:8080 # http_proxy = socks5://user:passwd@192.168.1.128:1080 # console or real logFile path like ./frpc.log log_file = ./frpc.log # trace, debug, info, warn, error log_level = info log_max_days = 3 # for authentication token = 12345678 # set admin address for control frpc's action by http api such as reload admin_addr = 127.0.0.1 admin_port = 7400 admin_user = admin admin_pwd = admin # connections will be established in advance, default value is zero pool_count = 5 # if tcp stream multiplexing is used, default is true, it must be same with frps tcp_mux = true # your proxy name will be changed to {user}.{proxy} user = yjd-notebook # decide if exit program when first login failed, otherwise continuous relogin to frps # default is true login_fail_exit = true # communication protocol used to connect to server # now it supports tcp and kcp and websocket, default is tcp protocol = tcp # specify a dns server, so frpc will use this instead of default one # dns_server = 8.8.8.8 # proxy names you want to start divided by ',' # default is empty, means all proxies # start = ssh,dns # heartbeat configure, it's not recommended to modify the default value # the default value of heartbeat_interval is 10 and heartbeat_timeout is 90 # heartbeat_interval = 30 # heartbeat_timeout = 90 [notebook_3389] type = xtcp # 只有 sk 一致的用户才能访问到此服务 sk = abcdefg local_ip = 127.0.0.1 local_port = 3389 use_encryption = true use_compression = true [desktop_3389_visitor] type = xtcp # xtcp 的访问者 role = visitor # 要访问的 xtcp 代理的名字 server_name = desktop_3389 sk = abcdefg # 绑定本地端口,用于和server的端口建立通道 bind_addr = 127.0.0.1 bind_port = 15000 use_encryption = true use_compression = true ``` **Steps to reproduce the issue:** 用windows自带的远程连接,连接127.0.0.1:15000,一直显示"正在配置远程会话..." **Describe the results you received:** 本地log: ``` 2019/01/01 01:35:21 [I] [service.go:205] login to server success, get run id [fbb9188c3f6c2f25], server udp port [7001] 2019/01/01 01:35:21 [I] [visitor_manager.go:69] [yjd-desktop.notebook_3389_visitor] start visitor success 2019/01/01 01:35:21 [I] [visitor_manager.go:112] visitor added: [yjd-desktop.notebook_3389_visitor] 2019/01/01 01:35:21 [I] [proxy_manager.go:136] [fbb9188c3f6c2f25] proxy added: [yjd-desktop.desktop_3389] 2019/01/01 01:35:21 [I] [service.go:100] admin server listen on 127.0.0.1:7400 2019/01/01 01:35:21 [I] [control.go:143] [yjd-desktop.desktop_3389] start proxy success 2019/01/01 01:35:41 [W] [visitor.go:235] [yjd-desktop.notebook_3389_visitor] get natHoleRespMsg error: read udp 192.168.2.4:53667->139.196.90.112:7001: i/o timeout 2019/01/01 01:36:46 [W] [visitor.go:235] [yjd-desktop.notebook_3389_visitor] get natHoleRespMsg error: read udp 192.168.2.4:51997->139.196.90.112:7001: i/o timeout ``` 服务器log: ``` 2018/12/31 17:35:21 [I] [service.go:319] client login info: ip [58.33.142.190:31931] version [0.22.0] hostname [] os [windows] arch [amd64] 2018/12/31 17:35:21 [I] [control.go:335] [fbb9188c3f6c2f25] new proxy [yjd-desktop.desktop_3389] success 2018/12/31 17:36:01 [I] [control.go:220] [1262c3d020e00642] control writer is closing 2018/12/31 17:36:01 [I] [proxy.go:73] [1262c3d020e00642] [yjd-notebook.notebook_3389] proxy closing 2018/12/31 17:36:01 [I] [control.go:292] [1262c3d020e00642] client exit success 2018/12/31 17:36:07 [I] [service.go:319] client login info: ip [180.175.162.253:54430] version [0.22.0] hostname [] os [windows] arch [amd64] 2018/12/31 17:36:07 [I] [control.go:335] [586a920ba84595f8] new proxy [yjd-notebook.notebook_3389] success ``` **Describe the results you expected:** **Additional information you deem important (e.g. issue happens only occasionally):** **Can you point out what caused this issue (optional)**
Author
Owner
<!-- gh-comment-id:450773045 --> @fatedier commented on GitHub (Jan 2, 2019): https://github.com/fatedier/frp/blob/master/README_zh.md#%E7%82%B9%E5%AF%B9%E7%82%B9%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F
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#816
No description provided.