Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
企猫商务
frp
提交
1325c59a
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 搜索 >>
未验证
提交
1325c59a
编写于
3月 21, 2018
作者:
F
fatedier
提交者:
GitHub
3月 21, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #672 from fatedier/dev
bump version to v0.16.1
上级
456ce090
82dc1e92
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
29 addition
and
23 deletion
+29
-23
.travis.yml
.travis.yml
+1
-2
Makefile
Makefile
+1
-6
Makefile.cross-compiles
Makefile.cross-compiles
+8
-4
cmd/frpc/main.go
cmd/frpc/main.go
+1
-1
conf/frpc_full.ini
conf/frpc_full.ini
+1
-1
models/config/proxy.go
models/config/proxy.go
+1
-1
models/proto/udp/udp.go
models/proto/udp/udp.go
+1
-0
package.sh
package.sh
+1
-1
server/control.go
server/control.go
+4
-2
utils/net/conn.go
utils/net/conn.go
+8
-3
utils/version/version.go
utils/version/version.go
+1
-1
utils/vhost/https.go
utils/vhost/https.go
+1
-1
未找到文件。
.travis.yml
浏览文件 @
1325c59a
...
...
@@ -2,8 +2,7 @@ sudo: false
language
:
go
go
:
-
1.8.x
-
1.9.x
-
1.10.x
install
:
-
make
...
...
Makefile
浏览文件 @
1325c59a
...
...
@@ -15,12 +15,7 @@ file:
go generate ./assets/...
fmt
:
go
fmt
./assets/...
go
fmt
./client/...
go
fmt
./cmd/...
go
fmt
./models/...
go
fmt
./server/...
go
fmt
./utils/...
go
fmt
./...
frps
:
go build
-o
bin/frps ./cmd/frps
...
...
Makefile.cross-compiles
浏览文件 @
1325c59a
...
...
@@ -9,6 +9,10 @@ build: app
app
:
env
CGO_ENABLED
=
0
GOOS
=
darwin
GOARCH
=
amd64 go build
-ldflags
"
$(LDFLAGS)
"
-o
./frpc_darwin_amd64 ./cmd/frpc
env
CGO_ENABLED
=
0
GOOS
=
darwin
GOARCH
=
amd64 go build
-ldflags
"
$(LDFLAGS)
"
-o
./frps_darwin_amd64 ./cmd/frps
env
CGO_ENABLED
=
0
GOOS
=
freebsd
GOARCH
=
386 go build
-ldflags
"
$(LDFLAGS)
"
-o
./frpc_freebsd_386 ./cmd/frpc
env
CGO_ENABLED
=
0
GOOS
=
freebsd
GOARCH
=
386 go build
-ldflags
"
$(LDFLAGS)
"
-o
./frps_freebsd_386 ./cmd/frps
env
CGO_ENABLED
=
0
GOOS
=
freebsd
GOARCH
=
amd64 go build
-ldflags
"
$(LDFLAGS)
"
-o
./frpc_freebsd_amd64 ./cmd/frpc
env
CGO_ENABLED
=
0
GOOS
=
freebsd
GOARCH
=
amd64 go build
-ldflags
"
$(LDFLAGS)
"
-o
./frps_freebsd_amd64 ./cmd/frps
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
386 go build
-ldflags
"
$(LDFLAGS)
"
-o
./frpc_linux_386 ./cmd/frpc
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
386 go build
-ldflags
"
$(LDFLAGS)
"
-o
./frps_linux_386 ./cmd/frps
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
amd64 go build
-ldflags
"
$(LDFLAGS)
"
-o
./frpc_linux_amd64 ./cmd/frpc
...
...
@@ -23,10 +27,10 @@ app:
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
mips64 go build
-ldflags
"
$(LDFLAGS)
"
-o
./frps_linux_mips64 ./cmd/frps
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
mips64le go build
-ldflags
"
$(LDFLAGS)
"
-o
./frpc_linux_mips64le ./cmd/frpc
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
mips64le go build
-ldflags
"
$(LDFLAGS)
"
-o
./frps_linux_mips64le ./cmd/frps
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
mips go build
-ldflags
"
$(LDFLAGS)
"
-o
./frpc_linux_mips ./cmd/frpc
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
mips go build
-ldflags
"
$(LDFLAGS)
"
-o
./frps_linux_mips ./cmd/frps
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
mipsle go build
-ldflags
"
$(LDFLAGS)
"
-o
./frpc_linux_mipsle ./cmd/frpc
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
mipsle go build
-ldflags
"
$(LDFLAGS)
"
-o
./frps_linux_mipsle ./cmd/frps
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
mips
GOMIPS
=
softfloat
go build
-ldflags
"
$(LDFLAGS)
"
-o
./frpc_linux_mips ./cmd/frpc
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
mips
GOMIPS
=
softfloat
go build
-ldflags
"
$(LDFLAGS)
"
-o
./frps_linux_mips ./cmd/frps
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
mipsle
GOMIPS
=
softfloat
go build
-ldflags
"
$(LDFLAGS)
"
-o
./frpc_linux_mipsle ./cmd/frpc
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
mipsle
GOMIPS
=
softfloat
go build
-ldflags
"
$(LDFLAGS)
"
-o
./frps_linux_mipsle ./cmd/frps
temp
:
env
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
amd64 go build
-ldflags
"
$(LDFLAGS)
"
-o
./frps_linux_amd64 ./cmd/frps
cmd/frpc/main.go
浏览文件 @
1325c59a
...
...
@@ -86,7 +86,7 @@ func main() {
if
args
[
"reload"
]
!=
nil
{
if
args
[
"reload"
]
.
(
bool
)
{
if
err
=
CmdReload
();
err
!=
nil
{
fmt
.
Printf
(
"frp
s
reload error: %v
\n
"
,
err
)
fmt
.
Printf
(
"frp
c
reload error: %v
\n
"
,
err
)
os
.
Exit
(
1
)
}
else
{
fmt
.
Printf
(
"reload success
\n
"
)
...
...
conf/frpc_full.ini
浏览文件 @
1325c59a
...
...
@@ -73,7 +73,7 @@ local_port = 22
# if remote_port is 0, frps will assgin a random port for you
remote_port
=
0
# if you want t
p
expose multiple ports, add 'range:' prefix to the section name
# if you want t
o
expose multiple ports, add 'range:' prefix to the section name
# frpc will generate multiple proxies such as 'tcp_port_6010', 'tcp_port_6011' and so on.
[range:tcp_port]
type
=
tcp
...
...
models/config/proxy.go
浏览文件 @
1325c59a
...
...
@@ -788,7 +788,7 @@ func ParseRangeSection(name string, section ini.Section) (sections map[string]in
return
}
if
len
(
localPorts
)
==
0
{
err
=
fmt
.
Errorf
(
"Parse conf error: range section [%s] local_port and remote_port is necessary"
)
err
=
fmt
.
Errorf
(
"Parse conf error: range section [%s] local_port and remote_port is necessary"
,
name
)
return
}
...
...
models/proto/udp/udp.go
浏览文件 @
1325c59a
...
...
@@ -82,6 +82,7 @@ func Forwarder(dstAddr *net.UDPAddr, readCh <-chan *msg.UdpPacket, sendCh chan<-
mu
.
Lock
()
delete
(
udpConnMap
,
addr
)
mu
.
Unlock
()
udpConn
.
Close
()
}()
buf
:=
pool
.
GetBuf
(
1500
)
...
...
package.sh
浏览文件 @
1325c59a
...
...
@@ -14,7 +14,7 @@ make -f ./Makefile.cross-compiles
rm
-rf
./packages
mkdir
./packages
os_all
=
'linux windows darwin'
os_all
=
'linux windows darwin
freebsd
'
arch_all
=
'386 amd64 arm mips64 mips64le mips mipsle'
for
os
in
$os_all
;
do
...
...
server/control.go
浏览文件 @
1325c59a
...
...
@@ -265,13 +265,14 @@ func (ctl *Control) stoper() {
ctl
.
conn
.
Close
()
ctl
.
readerShutdown
.
WaitDone
()
ctl
.
mu
.
Lock
()
defer
ctl
.
mu
.
Unlock
()
close
(
ctl
.
workConnCh
)
for
workConn
:=
range
ctl
.
workConnCh
{
workConn
.
Close
()
}
ctl
.
mu
.
Lock
()
defer
ctl
.
mu
.
Unlock
()
for
_
,
pxy
:=
range
ctl
.
proxies
{
pxy
.
Close
()
ctl
.
svr
.
DelProxy
(
pxy
.
GetName
())
...
...
@@ -303,6 +304,7 @@ func (ctl *Control) manager() {
if
time
.
Since
(
ctl
.
lastPing
)
>
time
.
Duration
(
config
.
ServerCommonCfg
.
HeartBeatTimeout
)
*
time
.
Second
{
ctl
.
conn
.
Warn
(
"heartbeat timeout"
)
ctl
.
allShutdown
.
Start
()
return
}
case
rawMsg
,
ok
:=
<-
ctl
.
readCh
:
if
!
ok
{
...
...
utils/net/conn.go
浏览文件 @
1325c59a
...
...
@@ -21,6 +21,7 @@ import (
"io"
"net"
"sync"
"sync/atomic"
"time"
"github.com/fatedier/frp/utils/log"
...
...
@@ -178,6 +179,7 @@ func (sc *SharedConn) WriteBuff(buffer []byte) (err error) {
type
StatsConn
struct
{
Conn
closed
int64
// 1 means closed
totalRead
int64
totalWrite
int64
statsFunc
func
(
totalRead
,
totalWrite
int64
)
...
...
@@ -203,9 +205,12 @@ func (statsConn *StatsConn) Write(p []byte) (n int, err error) {
}
func
(
statsConn
*
StatsConn
)
Close
()
(
err
error
)
{
err
=
statsConn
.
Conn
.
Close
()
if
statsConn
.
statsFunc
!=
nil
{
statsConn
.
statsFunc
(
statsConn
.
totalRead
,
statsConn
.
totalWrite
)
old
:=
atomic
.
SwapInt64
(
&
statsConn
.
closed
,
1
)
if
old
!=
1
{
err
=
statsConn
.
Conn
.
Close
()
if
statsConn
.
statsFunc
!=
nil
{
statsConn
.
statsFunc
(
statsConn
.
totalRead
,
statsConn
.
totalWrite
)
}
}
return
}
utils/version/version.go
浏览文件 @
1325c59a
...
...
@@ -19,7 +19,7 @@ import (
"strings"
)
var
version
string
=
"0.16.
0
"
var
version
string
=
"0.16.
1
"
func
Full
()
string
{
return
version
...
...
utils/vhost/https.go
浏览文件 @
1325c59a
...
...
@@ -108,7 +108,7 @@ func readHandshake(rd io.Reader) (host string, err error) {
return
}
if
len
(
data
)
<
2
{
err
=
fmt
.
Errorf
(
"readHandshake: extension dataLen[%d] is too short"
)
err
=
fmt
.
Errorf
(
"readHandshake: extension dataLen[%d] is too short"
,
len
(
data
)
)
return
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录