Frp: url 路由在复用 http 连接时失败

Created on 22 Nov 2017  ·  7Comments  ·  Source: fatedier/frp

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

0.13.0

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

Server:

Linux ubuntu 4.10.0-35-generic #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Configures you used:

Server:

[common]
max_pool_count = 32
bind_port = {{server port}}
vhost_http_port = 80
vhost_https_port = 443
privilege_token = {{token}}
dashboard_port = {{port}}
dashboard_user = {{username}}
dashboard_pwd = {{password}}

Client:

[common]
log_file = /dev/null
log_level = error
log_max_days = 1
login_fail_exit = false
protocol = tcp
privilege_token = {{token}}
server_addr = {{server ip}}
server_port = {{server port}}
user = {{user}}
dashboard_port = {{port}}
dashboard_user = {{username}}
dashboard_pwd = {{password}}

[Router]
type = http
custom_domains = {{router.customdomain.com}}
local_ip = 192.168.1.1
local_port = 80
use_gzip = false
use_encryption = false

[NAS]
type = http
custom_domains = {{www.customdomain.com}}
local_ip = 192.168.1.250
local_port = 5000
use_gzip = false
use_encryption = false

[File]
type = http
custom_domains = {{www.customdomain.com}}
local_ip = 192.168.1.250
local_port = 80
locations = /file
use_gzip = false
use_encryption = false

[Photo]
type = http
custom_domains = {{www.customdomain.com}}
local_ip = 192.168.1.250
local_port = 80
locations = /photo
use_gzip = false
use_encryption = false

Steps to reproduce the issue:

以上配置用于穿透局域网内群晖NAS

Test01:

  1. 访问 www.customdomain.com 成功进入群晖 DSM 首页
  2. 访问 www.customdomain.com/photo 不能进入 Photo Station,提示 抱歉,您所指定的页面不存在。
  3. 等待直至到 Dashboard 中 [NAS] 的 Connections 为0后再次访问 www.customdomain.com/photo 成功进入 Photo Station

Test02:

  1. 访问 www.customdomain.com/photo 成功进入 Photo Station
  2. 访问 www.customdomain.com 不能进入群晖 DSM 首页,URL被重定向到 www.customdomain.com:5000
  3. 等待直至到 Dashboard 中 [Photo] 的 Connections 为0后再次访问 www.customdomain.com 成功进入群晖 DSM 首页

Describe the results you received:

配置中 URL 路由为 //* 存在冲突

Describe the results you expected:

既能访问 www.customdomain.com 的同时也能访问 www.customdomain.com/*

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

None

Can you point out what caused this issue (optional)

None

question

Most helpful comment

0.14.1 版本优化 http 类型的 proxy,可以尝试下。

All 7 comments

群晖+docker更好用一些,把frpc设置到docker中如果有其他服务,就新启动一个容器。

如果想外网访问DSM,直接用群晖的DDNS即可

@idoall
群晖内部运行 Docker 的话会影响到休眠吧?这个比较不可控,因此我的 frpc 是放在路由器上的(软路由)
我没有公网IP,DDNS这个不行,群晖提供的 QuickConnect 速度太慢了

不会休眠,我的网站就是这样挂的,你用阿里云的ddns,不用群晖自己的

url 路由目前只解析每一个连接的第一个请求。浏览器对于同一个域名的请求可能会复用连接,所以同一个连接中的后续请求不会再被转发。这个目前还没有太好的解决方法,之后考虑下要怎么优化。

0.14.1 版本优化 http 类型的 proxy,可以尝试下。

@fatedier 访问已正常,感谢!

貌似 HTTPS 的复用也有上述问题呃

Was this page helpful?
0 / 5 - 0 ratings