Frp: 新版0.10.0 http类型不可以加密,压缩

Created on 24 May 2017  ·  19Comments  ·  Source: fatedier/frp

Type tcp / http
use_encryption = true
use_compression = true
客户端可以telnet端口通,不可以访问http网页,
use_encryption = false
use_compression = false
客户端访问http网页正常

0.9.3 http类型可以加密,压缩

bug

Most helpful comment

@rampageX 感谢你提供的详细的信息,临时编译的版本放在百度网盘上了,可以试试是否解决了你遇到的问题。

https://pan.baidu.com/s/1eRTu3mU
yfwm

All 19 comments

请按照 issue 模版提交问题,方便查看。

服务端配置:

[common]
bind_port = 7000
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin
vhost_http_port = 8888
tcp_mux = true
authentication_timeout = 900
privilege_token = xxxxxxxx
subdomain_host = a.b.c
max_pool_count = 50
log_file = /dev/null

客户端配置:

[http]
privilege_mode = true
type = http
local_ip = 127.0.0.1
local_port = 80

use_encryption = true

use_compression = true

subdomain = xyz
log_file = /dev/null

[ssh]
privilege_mode = true
remote_port = 22222
type = tcp
local_ip = 127.0.0.1
local_port = 22
use_encryption = true
use_compression = true
log_file = /dev/null

[http2]
privilege_mode = true
remote_port = 8080
type = tcp
local_ip = 127.0.0.1
local_port = 80

use_encryption = true

use_compression = true

log_file = /dev/null

若 [http] [http2]开启use_encryption use_compression选项 ,则
http://xyz.a.b.c:8888 与http://a.b.c:8080 不可以打开网页,但是 8888 8080 端口是通的
去掉use_encryption use_compression选项,2个页面打开均正常
[ssh] 可以正常使用use_encryption use_compression选项

在你 New issue 的时候不要删除里面的模版内容,按照模版内容填写相关信息。

另外你的问题无法复现。

客户端配置:为路由器 100%复现以上

你没有按照模版内容填写相关信息,所以缺少系统信息等内容,我也没有环境去复现,很难排查问题。

我这里也有这个问题。同样是运行在路由器上,映射到路由器的 Web 设置页面,端口是 8889。
路由器型号: ASUS RT-AC68P
操作系统: Tomato/Linux asus 2.6.36.4brcmarm #19 SMP PREEMPT Wed Apr 19 16:20:58 CEST 2017 armv7l GNU/Linux

配置文件 frpc.ini:

# [common] is integral section
[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 = test.com
server_port = 2000
# console or real logFile path like ./frpc.log
log_file = ./frpc.log
# debug, info, warn, error
log_level = info
log_max_days = 3
# for authentication
auth_token = tester
# for privilege mode
privilege_token = 88888888

[HTTP]
# tcp | http, default is tcp
privilege_mode = true
type = tcp
local_ip = 192.168.2.1
local_port = 8889
remote_port = 2009
# true or false, if true, messages between frps and frpc will be encrypted, default is false
use_encryption = false
# default is false
use_gzip = false
# connections will be established in advance, default value is zero
pool_count = 0

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

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

GOARCH="arm"
GOBIN=""
GOEXE=""
GOHOSTARCH="arm"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/mnt/data/compile/go"
GORACE=""
GOROOT="/mmc/usr/go"
GOTOOLDIR="/mmc/usr/go/pkg/tool/linux_arm"
GCCGO="gccgo"
GOARM=""
CC="gcc"
GOGCCFLAGS="-fPIC -marm -fmessage-length=0 -fdebug-prefix-map=/mmc/tmp/go-build138096640=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="0"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

Steps to reproduce the issue:

  1. 在 HTTP 段,设置 use_encryption = true
  2. 重启 frpc,浏览器不能打开路由器上的设置界面;
  3. 在 HTTP 段,设置 use_encryption = false
  4. 重启 frpc,浏览器可以打开路由器上的设置界面;

Describe the results you received:
当 use_encryption = true 是,可以跳出 Web 设置页面的用户名密码输入界面,证明端口转发成功,但是输入用户名密码后,浏览器只能显示出页面的标题,整个内容是空的,浏览器一直显示加载中;附上 Chrome F12 网络调试信息:

连接失败时:
e-on

连接成功时:
e-off

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)

@rampageX 推测和加密的方法有关,0.10.0 版本更新了加密的方法,不同平台的兼容性可能不是很好。不过我没有 arm 的机器,不方便调试。

@rampageX 找了一个手机测试了,仍然无法复现这个问题。

@fatedier 同一台路由器上同样版本的 frpc ,用 tcp 类型来转发 ssh 端口,启用加密也是可以的,是否可以排除与硬件/平台无关?

@rampageX 最好能够提供在 linux 系统上可以稳定复现的示例。

@fatedier
我又反复测试了几种情况:

  1. 分别把 frpc 运行在(与运行 Tomato 的路由器同在一个局域网的)树莓派3 和 Windows 10 上,如果开启加密,仍然打不开路由器的设置界面;
  2. frpc 无论是运行在路由器上,还是树莓派或者 Windows 10上,开启加密,能够访问 Ngnix 架设的 HTTP 服务器,以及另外一台基于原版固件的华硕路由器设置界面(它的认证界面看起来不像基础认证界面,而是华硕自己写的一个认证系统);
  3. 怀疑是 HTTP 基础认证问题,换一台刷了 DD-WRT 的路由器,开启 frpc 加密,输入用户名密码后,不能访问设置界面;
  4. 目前只能认为是 Tomato/DD-WRT 固件自带的 Web 服务器/页面认证与 frpc 的加密有兼容性问题。

@rampageX 你的测试结论是 华硕自己写的一个认证系统 开启加密后是正常的,但是如果本身的 web 服务有 HTTP Basic Auth 认证,则开启加密会导致不能访问?

@fatedier 是的。

我的也是这个问题,我联合kcptun一起用frp打开压缩,网站打不开,现在只能关闭压缩才能打开网页。

大致上定位到原因了,考虑下怎么修复。

@rampageX 感谢你提供的详细的信息,临时编译的版本放在百度网盘上了,可以试试是否解决了你遇到的问题。

https://pan.baidu.com/s/1eRTu3mU
yfwm

这个应该可以了。压缩能开网页了

可以了

lnzoro notifications@github.com于2017年6月6日 周二 08:31写道:

这个应该可以了。压缩能开网页了


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/fatedier/frp/issues/332#issuecomment-306347877, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AC5Fa1_8MFZdjb6b_OIaXWr_1p12dZ_rks5sBJ34gaJpZM4NkrCK
.

>

感谢您在百忙之中阅读我的信件。

@fatedier OK 啦!感谢!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhangyongcun picture zhangyongcun  ·  3Comments

fanmaomao picture fanmaomao  ·  3Comments

AngryBaby picture AngryBaby  ·  3Comments

zhanghu663 picture zhanghu663  ·  4Comments

Geilivable picture Geilivable  ·  4Comments