Skip to content

Commit

Permalink
修复:某些场景下丢包导致服务端意外退出
Browse files Browse the repository at this point in the history
优化:新增隧道时,不指定服务端口时,将自动生成端口号
优化:API返回ID, /client/add/, /index/addhost/,/index/add/
优化:域名解析、隧道页面,增加[唯一验证密钥],方便搜查
  • Loading branch information
yisier committed Dec 19, 2022
1 parent 5145273 commit b7aee56
Show file tree
Hide file tree
Showing 27 changed files with 3,325 additions and 19 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

## 更新日志

- 2022-12-19
***修复***:某些场景下丢包导致服务端意外退出
***优化***:新增隧道时,不指定服务端口时,将自动生成端口号
***优化***:API返回ID, `/client/add/, /index/addhost/,/index/add/ `
***优化***:域名解析、隧道页面,增加[唯一验证密钥],方便搜查


- 2022-10-30
***新增***:在管理面板中新增客户端时,可以配置多个黑名单IP,用于防止被肉鸡扫描端口或被恶意攻击。
***优化***:0.26.12 版本还原了注册系统功能,使用方式和以前一样。无论是否注册了系统服务,直接执行 nps 时只会读取当前目录下的配置文件。
Expand Down
2 changes: 1 addition & 1 deletion bridge/bridge.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package bridge

import (
"ehang.io/nps-mux"
"ehang.io/nps/lib/nps_mux"
"encoding/binary"
"errors"
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package client
import (
"bufio"
"bytes"
"ehang.io/nps-mux"
"ehang.io/nps/lib/nps_mux"
"net"
"net/http"
"strconv"
Expand Down
2 changes: 1 addition & 1 deletion client/local.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package client

import (
"ehang.io/nps-mux"
"ehang.io/nps/lib/nps_mux"
"errors"
"net"
"net/http"
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ module ehang.io/nps
go 1.15

require (
ehang.io/nps-mux v0.0.0-20210407130203-4afa0c10c992
fyne.io/fyne/v2 v2.0.2
github.com/astaxie/beego v1.12.0
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect
github.com/c4milo/unpackit v0.0.0-20170704181138-4ed373e9ef1c
github.com/ccding/go-stun v0.0.0-20180726100737-be486d185f3d
github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f
github.com/dsnet/compress v0.0.1 // indirect
github.com/golang/snappy v0.0.3
github.com/hooklift/assert v0.0.0-20170704181755-9d1defd6d214 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGii
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f h1:q/DpyjJjZs94bziQ7YkBmIlpqbVP7yw179rnzoNVX1M=
github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f/go.mod h1:QGrK8vMWWHQYQ3QU9bw9Y9OPNfxccGzfb41qjvVeXtY=
github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q=
github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo=
github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY=
Expand Down
2 changes: 1 addition & 1 deletion lib/file/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (s *DbUtils) GetHost(start, length int, id int, search string) ([]*Host, in
for _, key := range keys {
if value, ok := s.JsonDb.Hosts.Load(key); ok {
v := value.(*Host)
if search != "" && !(v.Id == common.GetIntNoErrByStr(search) || strings.Contains(v.Host, search) || strings.Contains(v.Remark, search)) {
if search != "" && !(v.Id == common.GetIntNoErrByStr(search) || strings.Contains(v.Host, search) || strings.Contains(v.Remark, search) || strings.Contains(v.Client.VerifyKey, search)) {
continue
}
if id == 0 || v.Client.Id == id {
Expand Down
Loading

0 comments on commit b7aee56

Please sign in to comment.