Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
企猫商务
frp
提交
9a849a29
F
frp
项目概览
企猫商务
/
frp
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
frp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
9a849a29
编写于
3月 22, 2021
作者:
F
fatedier
提交者:
GitHub
3月 22, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix config parse logic (#2323)
上级
6b80861b
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
70 addition
and
42 deletion
+70
-42
assets/frpc/statik/statik.go
assets/frpc/statik/statik.go
+1
-1
assets/frps/static/index.html
assets/frps/static/index.html
+1
-1
assets/frps/static/manifest.js
assets/frps/static/manifest.js
+1
-1
assets/frps/static/vendor.js
assets/frps/static/vendor.js
+1
-1
assets/frps/statik/statik.go
assets/frps/statik/statik.go
+1
-1
cmd/frpc/sub/root.go
cmd/frpc/sub/root.go
+8
-11
cmd/frps/root.go
cmd/frps/root.go
+10
-8
pkg/config/client.go
pkg/config/client.go
+15
-3
pkg/config/server.go
pkg/config/server.go
+23
-7
pkg/config/server_test.go
pkg/config/server_test.go
+4
-3
pkg/util/version/version.go
pkg/util/version/version.go
+1
-1
web/frps/src/utils/proxy.js
web/frps/src/utils/proxy.js
+4
-4
未找到文件。
assets/frpc/statik/statik.go
浏览文件 @
9a849a29
此差异已折叠。
点击以展开。
assets/frps/static/index.html
浏览文件 @
9a849a29
<!doctype html>
<html
lang=
en
>
<head>
<meta
charset=
utf-8
>
<title>
frps dashboard
</title>
<link
rel=
"shortcut icon"
href=
"favicon.ico"
></head>
<body>
<div
id=
app
></div>
<script
type=
"text/javascript"
src=
"manifest.js?9cdfcd28c7394b82e47d"
></script><script
type=
"text/javascript"
src=
"vendor.js?6aeb7e29d75bc1975785"
></script></body>
</html>
<!doctype html>
<html
lang=
en
>
<head>
<meta
charset=
utf-8
>
<title>
frps dashboard
</title>
<link
rel=
"shortcut icon"
href=
"favicon.ico"
></head>
<body>
<div
id=
app
></div>
<script
type=
"text/javascript"
src=
"manifest.js?782d7b1b910e824ac986"
></script><script
type=
"text/javascript"
src=
"vendor.js?7f899297af075fb3b085"
></script></body>
</html>
\ No newline at end of file
\ No newline at end of file
assets/frps/static/manifest.js
浏览文件 @
9a849a29
!
function
(
e
){
function
n
(
r
){
if
(
t
[
r
])
return
t
[
r
].
exports
;
var
o
=
t
[
r
]
=
{
i
:
r
,
l
:
!
1
,
exports
:{}};
return
e
[
r
].
call
(
o
.
exports
,
o
,
o
.
exports
,
n
),
o
.
l
=!
0
,
o
.
exports
}
var
r
=
window
.
webpackJsonp
;
window
.
webpackJsonp
=
function
(
t
,
c
,
u
){
for
(
var
i
,
a
,
f
,
l
=
0
,
s
=
[];
l
<
t
.
length
;
l
++
)
a
=
t
[
l
],
o
[
a
]
&&
s
.
push
(
o
[
a
][
0
]),
o
[
a
]
=
0
;
for
(
i
in
c
)
Object
.
prototype
.
hasOwnProperty
.
call
(
c
,
i
)
&&
(
e
[
i
]
=
c
[
i
]);
for
(
r
&&
r
(
t
,
c
,
u
);
s
.
length
;)
s
.
shift
()();
if
(
u
)
for
(
l
=
0
;
l
<
u
.
length
;
l
++
)
f
=
n
(
n
.
s
=
u
[
l
]);
return
f
};
var
t
=
{},
o
=
{
1
:
0
};
n
.
e
=
function
(
e
){
function
r
(){
i
.
onerror
=
i
.
onload
=
null
,
clearTimeout
(
a
);
var
n
=
o
[
e
];
0
!==
n
&&
(
n
&&
n
[
1
](
new
Error
(
"
Loading chunk
"
+
e
+
"
failed.
"
)),
o
[
e
]
=
void
0
)}
var
t
=
o
[
e
];
if
(
0
===
t
)
return
new
Promise
(
function
(
e
){
e
()});
if
(
t
)
return
t
[
2
];
var
c
=
new
Promise
(
function
(
n
,
r
){
t
=
o
[
e
]
=
[
n
,
r
]});
t
[
2
]
=
c
;
var
u
=
document
.
getElementsByTagName
(
"
head
"
)[
0
],
i
=
document
.
createElement
(
"
script
"
);
i
.
type
=
"
text/javascript
"
,
i
.
charset
=
"
utf-8
"
,
i
.
async
=!
0
,
i
.
timeout
=
12
e4
,
n
.
nc
&&
i
.
setAttribute
(
"
nonce
"
,
n
.
nc
),
i
.
src
=
n
.
p
+
""
+
e
+
"
.js?
"
+
{
0
:
"
6aeb7e29d75bc1975785
"
}[
e
];
var
a
=
setTimeout
(
r
,
12
e4
);
return
i
.
onerror
=
i
.
onload
=
r
,
u
.
appendChild
(
i
),
c
},
n
.
m
=
e
,
n
.
c
=
t
,
n
.
i
=
function
(
e
){
return
e
},
n
.
d
=
function
(
e
,
r
,
t
){
n
.
o
(
e
,
r
)
||
Object
.
defineProperty
(
e
,
r
,{
configurable
:
!
1
,
enumerable
:
!
0
,
get
:
t
})},
n
.
n
=
function
(
e
){
var
r
=
e
&&
e
.
__esModule
?
function
(){
return
e
.
default
}:
function
(){
return
e
};
return
n
.
d
(
r
,
"
a
"
,
r
),
r
},
n
.
o
=
function
(
e
,
n
){
return
Object
.
prototype
.
hasOwnProperty
.
call
(
e
,
n
)},
n
.
p
=
""
,
n
.
oe
=
function
(
e
){
throw
console
.
error
(
e
),
e
}}([]);
!
function
(
e
){
function
n
(
r
){
if
(
t
[
r
])
return
t
[
r
].
exports
;
var
o
=
t
[
r
]
=
{
i
:
r
,
l
:
!
1
,
exports
:{}};
return
e
[
r
].
call
(
o
.
exports
,
o
,
o
.
exports
,
n
),
o
.
l
=!
0
,
o
.
exports
}
var
r
=
window
.
webpackJsonp
;
window
.
webpackJsonp
=
function
(
t
,
u
,
c
){
for
(
var
i
,
a
,
f
,
l
=
0
,
s
=
[];
l
<
t
.
length
;
l
++
)
a
=
t
[
l
],
o
[
a
]
&&
s
.
push
(
o
[
a
][
0
]),
o
[
a
]
=
0
;
for
(
i
in
u
)
Object
.
prototype
.
hasOwnProperty
.
call
(
u
,
i
)
&&
(
e
[
i
]
=
u
[
i
]);
for
(
r
&&
r
(
t
,
u
,
c
);
s
.
length
;)
s
.
shift
()();
if
(
c
)
for
(
l
=
0
;
l
<
c
.
length
;
l
++
)
f
=
n
(
n
.
s
=
c
[
l
]);
return
f
};
var
t
=
{},
o
=
{
1
:
0
};
n
.
e
=
function
(
e
){
function
r
(){
i
.
onerror
=
i
.
onload
=
null
,
clearTimeout
(
a
);
var
n
=
o
[
e
];
0
!==
n
&&
(
n
&&
n
[
1
](
new
Error
(
"
Loading chunk
"
+
e
+
"
failed.
"
)),
o
[
e
]
=
void
0
)}
var
t
=
o
[
e
];
if
(
0
===
t
)
return
new
Promise
(
function
(
e
){
e
()});
if
(
t
)
return
t
[
2
];
var
u
=
new
Promise
(
function
(
n
,
r
){
t
=
o
[
e
]
=
[
n
,
r
]});
t
[
2
]
=
u
;
var
c
=
document
.
getElementsByTagName
(
"
head
"
)[
0
],
i
=
document
.
createElement
(
"
script
"
);
i
.
type
=
"
text/javascript
"
,
i
.
charset
=
"
utf-8
"
,
i
.
async
=!
0
,
i
.
timeout
=
12
e4
,
n
.
nc
&&
i
.
setAttribute
(
"
nonce
"
,
n
.
nc
),
i
.
src
=
n
.
p
+
""
+
e
+
"
.js?
"
+
{
0
:
"
7f899297af075fb3b085
"
}[
e
];
var
a
=
setTimeout
(
r
,
12
e4
);
return
i
.
onerror
=
i
.
onload
=
r
,
c
.
appendChild
(
i
),
u
},
n
.
m
=
e
,
n
.
c
=
t
,
n
.
i
=
function
(
e
){
return
e
},
n
.
d
=
function
(
e
,
r
,
t
){
n
.
o
(
e
,
r
)
||
Object
.
defineProperty
(
e
,
r
,{
configurable
:
!
1
,
enumerable
:
!
0
,
get
:
t
})},
n
.
n
=
function
(
e
){
var
r
=
e
&&
e
.
__esModule
?
function
(){
return
e
.
default
}:
function
(){
return
e
};
return
n
.
d
(
r
,
"
a
"
,
r
),
r
},
n
.
o
=
function
(
e
,
n
){
return
Object
.
prototype
.
hasOwnProperty
.
call
(
e
,
n
)},
n
.
p
=
""
,
n
.
oe
=
function
(
e
){
throw
console
.
error
(
e
),
e
}}([]);
\ No newline at end of file
\ No newline at end of file
assets/frps/static/vendor.js
浏览文件 @
9a849a29
此差异已折叠。
点击以展开。
assets/frps/statik/statik.go
浏览文件 @
9a849a29
此差异已折叠。
点击以展开。
cmd/frpc/sub/root.go
浏览文件 @
9a849a29
...
@@ -138,13 +138,11 @@ func parseClientCommonCfg(fileType int, source []byte) (cfg config.ClientCommonC
...
@@ -138,13 +138,11 @@ func parseClientCommonCfg(fileType int, source []byte) (cfg config.ClientCommonC
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
cfg
.
LogFile
==
"console"
{
cfg
.
LogWay
=
"console"
cfg
.
Complete
()
}
else
{
err
=
cfg
.
Validate
()
cfg
.
LogWay
=
"file"
}
err
=
cfg
.
Check
()
if
err
!=
nil
{
if
err
!=
nil
{
err
=
fmt
.
Errorf
(
"Parse config error: %v"
,
err
)
return
return
}
}
return
return
...
@@ -185,21 +183,20 @@ func runClient(cfgFilePath string) (err error) {
...
@@ -185,21 +183,20 @@ func runClient(cfgFilePath string) (err error) {
var
content
[]
byte
var
content
[]
byte
content
,
err
=
config
.
GetRenderedConfFromFile
(
cfgFilePath
)
content
,
err
=
config
.
GetRenderedConfFromFile
(
cfgFilePath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
err
}
}
cfg
,
err
:=
parseClientCommonCfg
(
CfgFileTypeIni
,
content
)
cfg
,
err
:=
parseClientCommonCfg
(
CfgFileTypeIni
,
content
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
err
}
}
pxyCfgs
,
visitorCfgs
,
err
:=
config
.
LoadAllProxyConfsFromIni
(
cfg
.
User
,
content
,
cfg
.
Start
)
pxyCfgs
,
visitorCfgs
,
err
:=
config
.
LoadAllProxyConfsFromIni
(
cfg
.
User
,
content
,
cfg
.
Start
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
err
}
}
err
=
startService
(
cfg
,
pxyCfgs
,
visitorCfgs
,
cfgFilePath
)
return
startService
(
cfg
,
pxyCfgs
,
visitorCfgs
,
cfgFilePath
)
return
}
}
func
startService
(
func
startService
(
...
...
cmd/frps/root.go
浏览文件 @
9a849a29
...
@@ -105,7 +105,6 @@ var rootCmd = &cobra.Command{
...
@@ -105,7 +105,6 @@ var rootCmd = &cobra.Command{
var
cfg
config
.
ServerCommonConf
var
cfg
config
.
ServerCommonConf
var
err
error
var
err
error
if
cfgFile
!=
""
{
if
cfgFile
!=
""
{
log
.
Info
(
"frps uses config file: %s"
,
cfgFile
)
var
content
[]
byte
var
content
[]
byte
content
,
err
=
config
.
GetRenderedConfFromFile
(
cfgFile
)
content
,
err
=
config
.
GetRenderedConfFromFile
(
cfgFile
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -113,7 +112,6 @@ var rootCmd = &cobra.Command{
...
@@ -113,7 +112,6 @@ var rootCmd = &cobra.Command{
}
}
cfg
,
err
=
parseServerCommonCfg
(
CfgFileTypeIni
,
content
)
cfg
,
err
=
parseServerCommonCfg
(
CfgFileTypeIni
,
content
)
}
else
{
}
else
{
log
.
Info
(
"frps uses command line arguments for config"
)
cfg
,
err
=
parseServerCommonCfg
(
CfgFileTypeCmd
,
nil
)
cfg
,
err
=
parseServerCommonCfg
(
CfgFileTypeCmd
,
nil
)
}
}
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -144,13 +142,10 @@ func parseServerCommonCfg(fileType int, source []byte) (cfg config.ServerCommonC
...
@@ -144,13 +142,10 @@ func parseServerCommonCfg(fileType int, source []byte) (cfg config.ServerCommonC
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
cfg
.
LogFile
==
"console"
{
cfg
.
Complete
()
cfg
.
LogWay
=
"console"
err
=
cfg
.
Validate
()
}
else
{
cfg
.
LogWay
=
"file"
}
err
=
cfg
.
Check
()
if
err
!=
nil
{
if
err
!=
nil
{
err
=
fmt
.
Errorf
(
"Parse config error: %v"
,
err
)
return
return
}
}
return
return
...
@@ -200,6 +195,13 @@ func parseServerCommonCfgFromCmd() (cfg config.ServerCommonConf, err error) {
...
@@ -200,6 +195,13 @@ func parseServerCommonCfgFromCmd() (cfg config.ServerCommonConf, err error) {
func
runServer
(
cfg
config
.
ServerCommonConf
)
(
err
error
)
{
func
runServer
(
cfg
config
.
ServerCommonConf
)
(
err
error
)
{
log
.
InitLog
(
cfg
.
LogWay
,
cfg
.
LogFile
,
cfg
.
LogLevel
,
cfg
.
LogMaxDays
,
cfg
.
DisableLogColor
)
log
.
InitLog
(
cfg
.
LogWay
,
cfg
.
LogFile
,
cfg
.
LogLevel
,
cfg
.
LogMaxDays
,
cfg
.
DisableLogColor
)
if
cfgFile
!=
""
{
log
.
Info
(
"frps uses config file: %s"
,
cfgFile
)
}
else
{
log
.
Info
(
"frps uses command line arguments for config"
)
}
svr
,
err
:=
server
.
NewService
(
cfg
)
svr
,
err
:=
server
.
NewService
(
cfg
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
...
pkg/config/client.go
浏览文件 @
9a849a29
...
@@ -173,13 +173,21 @@ func GetDefaultClientConf() ClientCommonConf {
...
@@ -173,13 +173,21 @@ func GetDefaultClientConf() ClientCommonConf {
}
}
}
}
func
(
cfg
*
ClientCommonConf
)
Check
()
error
{
func
(
cfg
*
ClientCommonConf
)
Complete
()
{
if
cfg
.
LogFile
==
"console"
{
cfg
.
LogWay
=
"console"
}
else
{
cfg
.
LogWay
=
"file"
}
}
func
(
cfg
*
ClientCommonConf
)
Validate
()
error
{
if
cfg
.
HeartbeatInterval
<=
0
{
if
cfg
.
HeartbeatInterval
<=
0
{
return
fmt
.
Errorf
(
"
Parse conf error:
invalid heartbeat_interval"
)
return
fmt
.
Errorf
(
"invalid heartbeat_interval"
)
}
}
if
cfg
.
HeartbeatTimeout
<
cfg
.
HeartbeatInterval
{
if
cfg
.
HeartbeatTimeout
<
cfg
.
HeartbeatInterval
{
return
fmt
.
Errorf
(
"
Parse conf error:
invalid heartbeat_timeout, heartbeat_timeout is less than heartbeat_interval"
)
return
fmt
.
Errorf
(
"invalid heartbeat_timeout, heartbeat_timeout is less than heartbeat_interval"
)
}
}
if
cfg
.
TLSEnable
==
false
{
if
cfg
.
TLSEnable
==
false
{
...
@@ -196,6 +204,10 @@ func (cfg *ClientCommonConf) Check() error {
...
@@ -196,6 +204,10 @@ func (cfg *ClientCommonConf) Check() error {
}
}
}
}
if
cfg
.
Protocol
!=
"tcp"
&&
cfg
.
Protocol
!=
"kcp"
&&
cfg
.
Protocol
!=
"websocket"
{
return
fmt
.
Errorf
(
"invalid protocol"
)
}
return
nil
return
nil
}
}
...
...
pkg/config/server.go
浏览文件 @
9a849a29
...
@@ -46,7 +46,7 @@ type ServerCommonConf struct {
...
@@ -46,7 +46,7 @@ type ServerCommonConf struct {
// this value is 0.
// this value is 0.
KCPBindPort
int
`ini:"kcp_bind_port" json:"kcp_bind_port"`
KCPBindPort
int
`ini:"kcp_bind_port" json:"kcp_bind_port"`
// ProxyBindAddr specifies the address that the proxy binds to. This value
// ProxyBindAddr specifies the address that the proxy binds to. This value
// may be the same as BindAddr.
By default, this value is "0.0.0.0".
// may be the same as BindAddr.
ProxyBindAddr
string
`ini:"proxy_bind_addr" json:"proxy_bind_addr"`
ProxyBindAddr
string
`ini:"proxy_bind_addr" json:"proxy_bind_addr"`
// VhostHTTPPort specifies the port that the server listens for HTTP Vhost
// VhostHTTPPort specifies the port that the server listens for HTTP Vhost
// requests. If this value is 0, the server will not listen for HTTP
// requests. If this value is 0, the server will not listen for HTTP
...
@@ -174,7 +174,7 @@ func GetDefaultServerConf() ServerCommonConf {
...
@@ -174,7 +174,7 @@ func GetDefaultServerConf() ServerCommonConf {
BindPort
:
7000
,
BindPort
:
7000
,
BindUDPPort
:
0
,
BindUDPPort
:
0
,
KCPBindPort
:
0
,
KCPBindPort
:
0
,
ProxyBindAddr
:
"
0.0.0.0
"
,
ProxyBindAddr
:
""
,
VhostHTTPPort
:
0
,
VhostHTTPPort
:
0
,
VhostHTTPSPort
:
0
,
VhostHTTPSPort
:
0
,
TCPMuxHTTPConnectPort
:
0
,
TCPMuxHTTPConnectPort
:
0
,
...
@@ -208,10 +208,6 @@ func GetDefaultServerConf() ServerCommonConf {
...
@@ -208,10 +208,6 @@ func GetDefaultServerConf() ServerCommonConf {
}
}
}
}
func
(
cfg
*
ServerCommonConf
)
Check
()
error
{
return
nil
}
func
UnmarshalServerConfFromIni
(
source
interface
{})
(
ServerCommonConf
,
error
)
{
func
UnmarshalServerConfFromIni
(
source
interface
{})
(
ServerCommonConf
,
error
)
{
f
,
err
:=
ini
.
LoadSources
(
ini
.
LoadOptions
{
f
,
err
:=
ini
.
LoadSources
(
ini
.
LoadOptions
{
...
@@ -242,7 +238,7 @@ func UnmarshalServerConfFromIni(source interface{}) (ServerCommonConf, error) {
...
@@ -242,7 +238,7 @@ func UnmarshalServerConfFromIni(source interface{}) (ServerCommonConf, error) {
if
allowPortStr
!=
""
{
if
allowPortStr
!=
""
{
allowPorts
,
err
:=
util
.
ParseRangeNumbers
(
allowPortStr
)
allowPorts
,
err
:=
util
.
ParseRangeNumbers
(
allowPortStr
)
if
err
!=
nil
{
if
err
!=
nil
{
return
ServerCommonConf
{},
fmt
.
Errorf
(
"
Parse conf error:
allow_ports: %v"
,
err
)
return
ServerCommonConf
{},
fmt
.
Errorf
(
"
invalid
allow_ports: %v"
,
err
)
}
}
for
_
,
port
:=
range
allowPorts
{
for
_
,
port
:=
range
allowPorts
{
common
.
AllowPorts
[
int
(
port
)]
=
struct
{}{}
common
.
AllowPorts
[
int
(
port
)]
=
struct
{}{}
...
@@ -269,6 +265,26 @@ func UnmarshalServerConfFromIni(source interface{}) (ServerCommonConf, error) {
...
@@ -269,6 +265,26 @@ func UnmarshalServerConfFromIni(source interface{}) (ServerCommonConf, error) {
return
common
,
nil
return
common
,
nil
}
}
func
(
cfg
*
ServerCommonConf
)
Complete
()
{
if
cfg
.
LogFile
==
"console"
{
cfg
.
LogWay
=
"console"
}
else
{
cfg
.
LogWay
=
"file"
}
if
cfg
.
ProxyBindAddr
==
""
{
cfg
.
ProxyBindAddr
=
cfg
.
BindAddr
}
if
cfg
.
TLSTrustedCaFile
!=
""
{
cfg
.
TLSOnly
=
true
}
}
func
(
cfg
*
ServerCommonConf
)
Validate
()
error
{
return
nil
}
func
loadHTTPPluginOpt
(
section
*
ini
.
Section
)
(
*
plugin
.
HTTPPluginOptions
,
error
)
{
func
loadHTTPPluginOpt
(
section
*
ini
.
Section
)
(
*
plugin
.
HTTPPluginOptions
,
error
)
{
name
:=
strings
.
TrimSpace
(
strings
.
TrimPrefix
(
section
.
Name
(),
"plugin."
))
name
:=
strings
.
TrimSpace
(
strings
.
TrimPrefix
(
section
.
Name
(),
"plugin."
))
...
...
pkg/config/server_test.go
浏览文件 @
9a849a29
...
@@ -18,7 +18,7 @@ import (
...
@@ -18,7 +18,7 @@ import (
"testing"
"testing"
"github.com/fatedier/frp/pkg/auth"
"github.com/fatedier/frp/pkg/auth"
"github.com/fatedier/frp/pkg/plugin/server"
plugin
"github.com/fatedier/frp/pkg/plugin/server"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/assert"
)
)
...
@@ -133,7 +133,7 @@ func Test_LoadServerCommonConf(t *testing.T) {
...
@@ -133,7 +133,7 @@ func Test_LoadServerCommonConf(t *testing.T) {
},
},
MaxPoolCount
:
59
,
MaxPoolCount
:
59
,
MaxPortsPerClient
:
9
,
MaxPortsPerClient
:
9
,
TLSOnly
:
fals
e
,
TLSOnly
:
tru
e
,
TLSCertFile
:
"server.crt"
,
TLSCertFile
:
"server.crt"
,
TLSKeyFile
:
"server.key"
,
TLSKeyFile
:
"server.key"
,
TLSTrustedCaFile
:
"ca.crt"
,
TLSTrustedCaFile
:
"ca.crt"
,
...
@@ -177,7 +177,7 @@ func Test_LoadServerCommonConf(t *testing.T) {
...
@@ -177,7 +177,7 @@ func Test_LoadServerCommonConf(t *testing.T) {
BindAddr
:
"0.0.0.9"
,
BindAddr
:
"0.0.0.9"
,
BindPort
:
7009
,
BindPort
:
7009
,
BindUDPPort
:
7008
,
BindUDPPort
:
7008
,
ProxyBindAddr
:
"0.0.0.
0
"
,
ProxyBindAddr
:
"0.0.0.
9
"
,
VhostHTTPTimeout
:
60
,
VhostHTTPTimeout
:
60
,
DashboardAddr
:
"0.0.0.0"
,
DashboardAddr
:
"0.0.0.0"
,
DashboardUser
:
"admin"
,
DashboardUser
:
"admin"
,
...
@@ -202,6 +202,7 @@ func Test_LoadServerCommonConf(t *testing.T) {
...
@@ -202,6 +202,7 @@ func Test_LoadServerCommonConf(t *testing.T) {
for
_
,
c
:=
range
testcases
{
for
_
,
c
:=
range
testcases
{
actual
,
err
:=
UnmarshalServerConfFromIni
(
c
.
source
)
actual
,
err
:=
UnmarshalServerConfFromIni
(
c
.
source
)
assert
.
NoError
(
err
)
assert
.
NoError
(
err
)
actual
.
Complete
()
assert
.
Equal
(
c
.
expected
,
actual
)
assert
.
Equal
(
c
.
expected
,
actual
)
}
}
}
}
pkg/util/version/version.go
浏览文件 @
9a849a29
...
@@ -19,7 +19,7 @@ import (
...
@@ -19,7 +19,7 @@ import (
"strings"
"strings"
)
)
var
version
string
=
"0.36.
1
"
var
version
string
=
"0.36.
2
"
func
Full
()
string
{
func
Full
()
string
{
return
version
return
version
...
...
web/frps/src/utils/proxy.js
浏览文件 @
9a849a29
...
@@ -54,8 +54,8 @@ class HttpProxy extends BaseProxy {
...
@@ -54,8 +54,8 @@ class HttpProxy extends BaseProxy {
this
.
custom_domains
=
proxyStats
.
conf
.
custom_domains
this
.
custom_domains
=
proxyStats
.
conf
.
custom_domains
this
.
host_header_rewrite
=
proxyStats
.
conf
.
host_header_rewrite
this
.
host_header_rewrite
=
proxyStats
.
conf
.
host_header_rewrite
this
.
locations
=
proxyStats
.
conf
.
locations
this
.
locations
=
proxyStats
.
conf
.
locations
if
(
proxyStats
.
conf
.
sub
_
domain
!=
""
)
{
if
(
proxyStats
.
conf
.
subdomain
!=
""
)
{
this
.
subdomain
=
proxyStats
.
conf
.
sub
_
domain
+
"
.
"
+
subdomain_host
this
.
subdomain
=
proxyStats
.
conf
.
subdomain
+
"
.
"
+
subdomain_host
}
else
{
}
else
{
this
.
subdomain
=
""
this
.
subdomain
=
""
}
}
...
@@ -75,8 +75,8 @@ class HttpsProxy extends BaseProxy {
...
@@ -75,8 +75,8 @@ class HttpsProxy extends BaseProxy {
this
.
port
=
port
this
.
port
=
port
if
(
proxyStats
.
conf
!=
null
)
{
if
(
proxyStats
.
conf
!=
null
)
{
this
.
custom_domains
=
proxyStats
.
conf
.
custom_domains
this
.
custom_domains
=
proxyStats
.
conf
.
custom_domains
if
(
proxyStats
.
conf
.
sub
_
domain
!=
""
)
{
if
(
proxyStats
.
conf
.
subdomain
!=
""
)
{
this
.
subdomain
=
proxyStats
.
conf
.
sub
_
domain
+
"
.
"
+
subdomain_host
this
.
subdomain
=
proxyStats
.
conf
.
subdomain
+
"
.
"
+
subdomain_host
}
else
{
}
else
{
this
.
subdomain
=
""
this
.
subdomain
=
""
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录