Skip to content

Commit c9b7553

Browse files
authored
Merge pull request #478 from ehang-io/dev, close #475, close #461
Dev
2 parents f22914c + 1b3dc6d commit c9b7553

File tree

10 files changed

+60
-50
lines changed

10 files changed

+60
-50
lines changed

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.5
2+
export VERSION=0.26.6
33
export GOPROXY=direct
44

55
sudo apt-get update

cmd/npc/npc.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ func run() {
218218
commonConfig.Client = new(file.Client)
219219
commonConfig.Client.Cnf = new(file.Config)
220220
go client.StartLocalServer(localServer, commonConfig)
221-
return
222221
}
223222
env := common.GetEnvMap()
224223
if *serverAddr == "" {

cmd/nps/nps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ type nps struct {
159159

160160
func (p *nps) Start(s service.Service) error {
161161
_, _ = s.Status()
162-
_ = p.run()
162+
go p.run()
163163
return nil
164164
}
165165
func (p *nps) Stop(s service.Service) error {

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.5</small>
3+
# NPS <small>0.26.6</small>
44

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

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module ehang.io/nps
33
go 1.13
44

55
require (
6-
ehang.io/nps-mux v0.0.0-20200310052025-e00374a8cdb6
6+
ehang.io/nps-mux v0.0.0-20200319121657-f4af26331c9f
77
fyne.io/fyne v1.2.3
88
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
99
github.com/astaxie/beego v1.12.0
@@ -21,7 +21,9 @@ require (
2121
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
2222
github.com/shirou/gopsutil v2.19.11+incompatible
2323
github.com/xtaci/kcp-go v5.4.20+incompatible
24+
golang.org/x/crypto v0.0.0-20200317142112-1b76d66859c6 // indirect
2425
golang.org/x/net v0.0.0-20200301022130-244492dfa37a
26+
golang.org/x/sys v0.0.0-20200317113312-5766fd39f98d // indirect
2527
)
2628

2729
replace github.com/astaxie/beego => github.com/exfly/beego v1.12.0-export-init

go.sum

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ehang.io/nps-mux v0.0.0-20200310052025-e00374a8cdb6 h1:kba4642Cj4R9wXrRfxjhP1nSHaA8FwfFQfhA1jX5Spw=
2-
ehang.io/nps-mux v0.0.0-20200310052025-e00374a8cdb6/go.mod h1:hTpHjFEac582vs7OjOaN8R2o3EOPOs2qeBeqTvIQAgs=
1+
ehang.io/nps-mux v0.0.0-20200319121657-f4af26331c9f h1:uAc/HZ939kibvYzVCPc1kp24PEjxxJy/N4Gs3Ybpm1Q=
2+
ehang.io/nps-mux v0.0.0-20200319121657-f4af26331c9f/go.mod h1:hTpHjFEac582vs7OjOaN8R2o3EOPOs2qeBeqTvIQAgs=
33
fyne.io/fyne v1.2.3 h1:5xwtSBNjxxmg+GF/lYvvf4xPzyjgWQoJVrzb+bt5gaA=
44
fyne.io/fyne v1.2.3/go.mod h1:JhDdBrPP/Kdr1H5ZT3HW8E/6zlz+GkOldWqSirGBDnY=
55
github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
@@ -120,6 +120,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
120120
golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
121121
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM=
122122
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
123+
golang.org/x/crypto v0.0.0-20200317142112-1b76d66859c6 h1:TjszyFsQsyZNHwdVdZ5m7bjmreu0znc2kRYsEml9/Ww=
124+
golang.org/x/crypto v0.0.0-20200317142112-1b76d66859c6/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
123125
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8 h1:idBdZTd9UioThJp8KpM/rTSinK/ChZFBE43/WtIy8zg=
124126
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
125127
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
@@ -139,6 +141,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
139141
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
140142
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
141143
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
144+
golang.org/x/sys v0.0.0-20200317113312-5766fd39f98d h1:62ap6LNOjDU6uGmKXHJbSfciMoV+FeI1sRXx/pLDL44=
145+
golang.org/x/sys v0.0.0-20200317113312-5766fd39f98d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
142146
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
143147
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
144148
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=

gui/npc/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
package="org.nps.client"
55
android:versionCode="1"
6-
android:versionName="0.26.5">
6+
android:versionName="0.26.6">
77

88
<application android:label="Npc" android:debuggable="true">
99
<activity android:name="org.golang.app.GoNativeActivity"

lib/version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package version
22

3-
const VERSION = "0.26.5"
3+
const VERSION = "0.26.6"
44

55
// Compulsory minimum version, Minimum downward compatibility to this version
66
func GetVersion() string {

web/controllers/client.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ func (s *ClientController) Add() {
6161
FlowLimit: int64(s.GetIntNoErr("flow_limit")),
6262
},
6363
}
64-
if t.RateLimit > 0 {
65-
t.Rate = rate.NewRate(int64(t.RateLimit * 1024))
66-
t.Rate.Start()
67-
}
6864
if err := file.GetDb().NewClient(t); err != nil {
6965
s.AjaxErr(err.Error())
7066
}

web/views/index/add.html

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h3 class="ibox-title" langtag="page-add"></h3>
77
<div class="form-group">
88
<label class="control-label font-bold" langtag="word-scheme"></label>
99
<div class="col-sm-10">
10-
<span class="help-block m-b-none font-bold" langtag="word-usecase"></span>:
10+
<span class="help-block m-b-none font-bold" langtag="word-usecase"></span>:
1111
<span id="usecase">
1212
<span id="casetcp" langtag="info-casetcp"></span>
1313
<span id="caseudp" langtag="info-caseudp"></span>
@@ -24,86 +24,95 @@ <h3 class="ibox-title" langtag="page-add"></h3>
2424
<option value="socks5" langtag="scheme-socks5"></option>
2525
<option value="secret" langtag="scheme-secret"></option>
2626
<option value="p2p" langtag="scheme-p2p"></option>
27-
{{/*<option value="file" langtag="scheme-file"></option>*/}}
27+
{{/*<option value="file" langtag="scheme-file"></option>*/}}
2828
</select>
2929
</div>
3030
</div>
3131

3232
<div class="form-group" id="client_id">
3333
<label class="control-label font-bold" langtag="word-clientid"></label>
3434
<div class="col-sm-10">
35-
<input value="{{.client_id}}" class="form-control" type="text" name="client_id" placeholder="" langtag="word-clientid">
35+
<input value="{{.client_id}}" class="form-control" type="text" name="client_id"
36+
placeholder="" langtag="word-clientid">
3637
</div>
3738
</div>
3839

3940
<div class="form-group">
4041
<label class="control-label font-bold" langtag="word-remark"></label>
4142
<div class="col-sm-10">
42-
<input class="form-control" type="text" name="remark" placeholder="" langtag="info-unrestricted">
43+
<input class="form-control" type="text" name="remark" placeholder=""
44+
langtag="info-unrestricted">
4345
</div>
4446
</div>
45-
{{if eq true .allow_multi_ip}}
46-
<div class="form-group" id="server_ip">
47-
<label class="control-label font-bold" langtag="word-serverip"></label>
48-
<div class="col-sm-10">
49-
<input class="form-control" type="text" value="0.0.0.0" name="server_ip" placeholder="" langtag="info-suchasip">
47+
{{if eq true .allow_multi_ip}}
48+
<div class="form-group" id="server_ip">
49+
<label class="control-label font-bold" langtag="word-serverip"></label>
50+
<div class="col-sm-10">
51+
<input class="form-control" type="text" value="0.0.0.0" name="server_ip" placeholder=""
52+
langtag="info-suchasip">
53+
</div>
5054
</div>
51-
</div>
52-
{{end}}
55+
{{end}}
5356
<div class="form-group" id="port">
5457
<label class="control-label font-bold" langtag="word-serverport"></label>
5558
<div class="col-sm-10">
56-
<input class="form-control" type="text" name="port" placeholder="" langtag="info-suchasport">
59+
<input class="form-control" type="text" name="port" placeholder=""
60+
langtag="info-suchasport">
5761
</div>
5862
</div>
5963

60-
{{if eq true .allow_local_proxy}}
61-
<div class="form-group" id="local_proxy">
62-
<label class="control-label font-bold" langtag="word-proxytolocal"></label>
63-
<div class="col-sm-10">
64-
<select class="form-control" name="local_proxy">
65-
<option value="0" langtag="word-no"></option>
66-
<option value="1" langtag="word-yes"></option>
67-
</select>
64+
{{if eq true .allow_local_proxy}}
65+
<div class="form-group" id="local_proxy">
66+
<label class="control-label font-bold" langtag="word-proxytolocal"></label>
67+
<div class="col-sm-10">
68+
<select class="form-control" name="local_proxy">
69+
<option value="0" langtag="word-no"></option>
70+
<option value="1" langtag="word-yes"></option>
71+
</select>
72+
</div>
6873
</div>
69-
</div>
70-
{{end}}
74+
{{end}}
7175

7276
<div class="form-group" id="target">
7377
<label class="control-label font-bold" langtag="word-target"></label>
7478
<div class="col-sm-10">
75-
<textarea class="form-control" name="target" rows="4" placeholder="" langtag="info-suchasiplist"></textarea>
79+
<textarea class="form-control" name="target" rows="4" placeholder=""
80+
langtag="info-suchasiplist"></textarea>
7681
<span class="help-block m-b-none" langtag="info-targettunnel"></span>
7782
</div>
7883
</div>
7984

8085
<div class="form-group" id="local_path">
8186
<label class="control-label font-bold" langtag="word-localpath"></label>
8287
<div class="col-sm-10">
83-
<input class="form-control" type="text" name="local_path" placeholder="" langtag="info-suchaslocalpath">
88+
<input class="form-control" type="text" name="local_path" placeholder=""
89+
langtag="info-suchaslocalpath">
8490
</div>
8591
</div>
8692

8793
<div class="form-group" id="strip_pre">
8894
<label class="control-label font-bold" langtag="word-stripprefix"></label>
8995
<div class="col-sm-10">
90-
<input class="form-control" type="text" name="strip_pre" placeholder="" langtag="info-suchasstripprefix">
96+
<input class="form-control" type="text" name="strip_pre" placeholder=""
97+
langtag="info-suchasstripprefix">
9198
</div>
9299
</div>
93100

94101
<div class="form-group" id="password">
95102
<label class="control-label font-bold" langtag="word-identificationkey"></label>
96103
<div class="col-sm-10">
97-
<input class="form-control" type="text" name="password" placeholder="" langtag="word-identificationkey">
104+
<input class="form-control" type="text" name="password" placeholder=""
105+
langtag="word-identificationkey">
98106
<span class="help-block m-b-none" langtag="info-identificationkey"></span>
99107
</div>
100108
</div>
101109
<div class="hr-line-dashed"></div>
102110
<div class="form-group">
103111
<div class="col-sm-4 col-sm-offset-2">
104-
<button class="btn btn-success" type="button" onclick="submitform('add', '{{.web_base_url}}/index/add', $('form').serializeArray())">
112+
<button class="btn btn-success" type="button"
113+
onclick="submitform('add', '{{.web_base_url}}/index/add', $('form').serializeArray())">
105114
<i class="fa fa-fw fa-lg fa-check-circle"></i> <span langtag="word-add"></span>
106-
</button>
115+
</button>
107116
</div>
108117
</div>
109118

@@ -114,20 +123,20 @@ <h3 class="ibox-title" langtag="page-add"></h3>
114123
</div>
115124
<script>
116125
var arr = []
117-
arr["all"] = ["port", "target", "password", "local_path", "strip_pre", "local_proxy"]
118-
arr["tcp"] = ["port", "target", "local_proxy"]
119-
arr["udp"] = ["port", "target", "local_proxy"]
120-
arr["socks5"] = ["port"]
121-
arr["httpProxy"] = ["port"]
122-
arr["secret"] = ["target", "password"]
123-
arr["p2p"] = ["target", "password"]
124-
arr["file"] = ["port", "local_path", "strip_pre"]
126+
arr["all"] = ["port", "target", "password", "local_path", "strip_pre", "local_proxy", "client_id", "server_ip"]
127+
arr["tcp"] = ["port", "target", "local_proxy", "client_id", "server_ip"]
128+
arr["udp"] = ["port", "target", "local_proxy", "client_id", "server_ip"]
129+
arr["socks5"] = ["port", "client_id", "server_ip"]
130+
arr["httpProxy"] = ["port", "client_id", "server_ip"]
131+
arr["secret"] = ["target", "password", "client_id", "server_ip"]
132+
arr["p2p"] = ["target", "password", "client_id", "server_ip"]
133+
arr["file"] = ["port", "local_path", "strip_pre", "client_id", "server_ip"]
125134

126135
function resetForm() {
127136
$(".form-group[id]").css("display", "none");
128137
$("#usecase span").css("display", "none");
129138
o = $("#type").val();
130-
$('#case'+ o).css("display", "inline")
139+
$('#case' + o).css("display", "inline")
131140
for (var i = 0; i < arr[o].length; i++) {
132141
$("#" + arr[o][i]).css("display", "block")
133142
}

0 commit comments

Comments
 (0)