Skip to content

Commit 7ede000

Browse files
authored
Merge pull request #401 from ehang-io/dev
Dev
2 parents 5c37505 + a4247eb commit 7ede000

File tree

28 files changed

+147
-50
lines changed

28 files changed

+147
-50
lines changed

build.android.sh

100644100755
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
#/bin/bash
2-
#sudo apt-get install libgl1-mesa-dev xorg-dev
3-
#go get github.com/ffdfgdfg/fyne-cross
4-
#fyne-cross --targets=linux/amd64,windows/amd64,darwin/amd64 gui/npc/npc.go
52

63
cd /go
74
apt-get install libegl1-mesa-dev libgles2-mesa-dev libx11-dev -y
8-
#go get -u fyne.io/fyne/cmd/fyne fyne.io/fyne
9-
mkdir -p /go/src/fyne.io
10-
cd src/fyne.io
11-
git clone https://github.com/fyne-io/fyne.git
12-
cd fyne
13-
git checkout v1.2.0
14-
go install -v ./cmd/fyne
5+
go get -u fyne.io/fyne/cmd/fyne fyne.io/fyne
6+
#mkdir -p /go/src/fyne.io
7+
#cd src/fyne.io
8+
#git clone https://github.com/fyne-io/fyne.git
9+
#cd fyne
10+
#git checkout v1.2.0
11+
#go install -v ./cmd/fyne
1512
#fyne package -os android fyne.io/fyne/cmd/hello
1613
echo "fyne install success"
1714
mkdir -p /go/src/ehang.io/nps
@@ -32,8 +29,6 @@ rm -rf vendor
3229
#rm -rf ~/.cache/*
3330
echo "vendor success"
3431
cd gui/npc
35-
#rm -rf /go/src/golang.org/x/mobile
36-
#go get -u fyne.io/fyne/cmd/fyne@v1.2.0
37-
#export ANDROID_NDK_HOME=/usr/local/android_sdk/ndk-bundle
3832
fyne package -appID org.nps.client -os android -icon ../../docs/logo.png
3933
mv npc.apk /app/android_client.apk
34+
echo "android build success"

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#/bash/sh
2-
export VERSION=0.26.1
2+
export VERSION=0.26.2
33

44
sudo apt-get install gcc-mingw-w64-i686
55
env GOOS=windows GOARCH=386 CGO_ENABLED=1 CC=i686-w64-mingw32-gcc go build -ldflags "-s -w -extldflags -static -extldflags -static" -buildmode=c-shared -o npc_sdk.dll cmd/npc/sdk.go

client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ func (s *TRPClient) handleChan(src net.Conn) {
216216
func (s *TRPClient) handleUdp(serverConn net.Conn) {
217217
// bind a local udp port
218218
local, err := net.ListenUDP("udp", nil)
219-
defer local.Close()
220219
defer serverConn.Close()
221220
if err != nil {
222221
logs.Error("bind local udp port error ", err.Error())
223222
return
224223
}
224+
defer local.Close()
225225
go func() {
226226
defer serverConn.Close()
227227
b := common.BufPoolUdp.Get().([]byte)

cmd/npc/npc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ var (
3333
localType = flag.String("local_type", "p2p", "p2p target")
3434
logPath = flag.String("log_path", "", "npc log path")
3535
debug = flag.Bool("debug", true, "npc debug")
36+
pprofAddr = flag.String("pprof", "", "PProf debug addr (ip:port)")
3637
)
3738

3839
const systemdScript = `[Unit]
@@ -171,6 +172,7 @@ func (p *npc) run() error {
171172
logs.Warning("npc: panic serving %v: %v\n%s", err, string(buf))
172173
}
173174
}()
175+
common.InitPProfFromArg(*pprofAddr)
174176
//p2p or secret command
175177
if *password != "" {
176178
commonConfig := new(config.CommonConfig)

cmd/nps/nps.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ func main() {
5959
if err := beego.LoadAppConfig("ini", filepath.Join(common.GetRunPath(), "conf", "nps.conf")); err != nil {
6060
log.Fatalln("load config file error", err.Error())
6161
}
62+
common.InitPProfFromFile()
6263
if level = beego.AppConfig.String("log_level"); level == "" {
6364
level = "7"
6465
}

conf/npc.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ web_username=user
1212
web_password=1234
1313
crypt=true
1414
compress=true
15+
#pprof_addr=0.0.0.0:9999
1516

1617
[health_check_test1]
1718
health_check_timeout=1

conf/nps.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,7 @@ http_cache_length=100
7676

7777
#get origin ip
7878
http_add_origin_header=false
79+
80+
#pprof debug options
81+
#pprof_ip=0.0.0.0
82+
#pprof_port=9999

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# nps
22
![](https://img.shields.io/github/stars/cnlh/nps.svg) ![](https://img.shields.io/github/forks/cnlh/nps.svg)
33
[![Gitter](https://badges.gitter.im/cnlh-nps/community.svg)](https://gitter.im/cnlh-nps/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
4-
[![Build Status](https://travis-ci.org/cnlh/nps.svg?branch=master)](https://travis-ci.org/cnlh/nps)
4+
[![Build Status](https://travis-ci.org/ehang-io/nps.svg?branch=master)](https://travis-ci.org/cnlh/nps)
55

66
nps是一款轻量级、高性能、功能强大的**内网穿透**代理服务器。目前支持**tcp、udp流量转发**,可支持任何**tcp、udp**上层协议(访问内网网站、本地支付接口调试、ssh访问、远程桌面,内网dns解析等等……),此外还**支持内网http代理、内网socks5代理****p2p等**,并带有功能强大的web管理端。
77

docs/_coverpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![logo](logo.svg)
22

3-
# NPS <small>0.26.1</small>
3+
# NPS <small>0.26.2</small>
44

55
> 一款轻量级、高性能、功能强大的内网穿透代理服务器
66

docs/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
* 其他
2424

25+
* [FAQ](faq.md)
2526
* [贡献](contribute.md)
2627
* [捐助](donate.md)
2728
* [致谢](thanks.md)

0 commit comments

Comments
 (0)