Compare commits

...
4 Commits
Author SHA1 Message Date
yisier 831fe8e32e 0.26.24 2025-04-17 17:37:10 +08:00
yisier 50e2da3fcb v0.26.24 2025-04-16 16:45:39 +08:00
yisier 7db25b9c3a v0.26.24 2025-04-16 16:44:09 +08:00
yisier be3358b744 v0.26.24 2025-04-16 16:43:29 +08:00
10 changed files with 82 additions and 25 deletions
-18
View File
@@ -73,21 +73,3 @@ jobs:
npc_sdk.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_android:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build
run: |
chmod +x build.android.sh
docker run --rm -i -w /app -v $(pwd):/app -e ANDROID_HOME=/usr/local/android_sdk -e GOPROXY=direct fyneio/fyne-cross:android-latest /app/build.android.sh
- name: Upload
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
android_client.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+9
View File
@@ -32,6 +32,15 @@ https://natnps.com/
## 更新日志
- 2025-04-16 v0.26.24
新增:
- 隧道支持复制功能,在隧道页面增加复制按钮,除了端口号为随机生成外,其他参数全部拷贝。[251](https://github.com/yisier/nps/issues/251)
修复:
- 私密代理连接时服务端会报错退出,[250](https://github.com/yisier/nps/issues/250)
- 2025-04-11 v0.26.23
新增:
- TCP 隧道支持 Proxy Protocol 协议来传递经过请求的真实 IP。![img.png](image/new/protocol.png)
+1 -1
View File
@@ -1,5 +1,5 @@
#/bash/sh
export VERSION=0.26.23
export VERSION=0.26.24
export GOPROXY=direct
sudo apt-get update
+1 -1
View File
@@ -1,6 +1,6 @@
package version
const VERSION = "0.26.23"
const VERSION = "0.26.24"
// Compulsory minimum version, Minimum downward compatibility to this version
func GetVersion() string {
+6 -1
View File
@@ -109,7 +109,12 @@ func (s *BaseServer) DealClient(c *conn.Conn, client *file.Client, addr string,
return nil
}
link := conn.NewLink(tp, addr, client.Cnf.Crypt, client.Cnf.Compress, c.Conn.RemoteAddr().String(), localProxy, task.ProtoVersion)
protoVersion := ""
if task != nil {
protoVersion = task.ProtoVersion
}
link := conn.NewLink(tp, addr, client.Cnf.Crypt, client.Cnf.Compress, c.Conn.RemoteAddr().String(), localProxy, protoVersion)
if target, err := s.bridge.SendLinkInfo(client.Id, link, s.task); err != nil {
logs.Warn("get connection from client id %d error %s", client.Id, err.Error())
c.Close()
+47
View File
@@ -132,6 +132,53 @@ func (s *IndexController) Add() {
}
}
}
func (s *IndexController) Copy() {
oldId := s.GetIntNoErr("id")
if oldTask, err := file.GetDb().GetTask(oldId); err != nil {
s.error()
} else {
if client, err := file.GetDb().GetClient(oldTask.Client.Id); err != nil {
s.AjaxErr("modified error,the client is not exist")
return
} else {
oldTask.Client = client
}
id := int(file.GetDb().JsonDb.GetTaskId())
newTask := &file.Tunnel{
Client: oldTask.Client,
Port: tool.GenerateServerPort(oldTask.Mode),
ServerIp: oldTask.ServerIp,
Mode: oldTask.Mode,
Target: oldTask.Target,
Id: id,
Status: true,
Remark: oldTask.Remark,
Password: oldTask.Password,
LocalPath: oldTask.LocalPath,
StripPre: oldTask.StripPre,
ProtoVersion: oldTask.ProtoVersion,
Flow: &file.Flow{},
}
if !tool.TestServerPort(newTask.Port, newTask.Mode) {
s.AjaxErr("The port cannot be opened because it may has been occupied or is no longer allowed.")
}
if newTask.Client.MaxTunnelNum != 0 && newTask.Client.GetTunnelNum() >= newTask.Client.MaxTunnelNum {
s.AjaxErr("The number of tunnels exceeds the limit")
}
if err := file.GetDb().NewTask(newTask); err != nil {
s.AjaxErr(err.Error())
}
if err := server.AddTask(newTask); err != nil {
s.AjaxErr(err.Error())
} else {
s.AjaxOkWithId("add success", id)
}
}
}
func (s *IndexController) GetOneTunnel() {
id := s.GetIntNoErr("id")
data := make(map[string]interface{})
+1
View File
@@ -144,6 +144,7 @@ function submitform(action, url, postdata) {
case 'start':
case 'stop':
case 'delete':
case 'copy':
var langobj = languages['content']['confirm'][action];
action = (langobj[languages['current']] || langobj[languages['default']] || 'Are you sure you want to ' + action + ' it?');
if (! confirm(action)) return;
+8
View File
@@ -189,6 +189,10 @@
<zh-CN>访问端命令</zh-CN>
<en-US>Access command</en-US>
</lang>
<lang id="word-protoversion">
<zh-CN>Proxy Protocol Version</zh-CN>
<en-US>Proxy Protocol Version</en-US>
</lang>
<lang id="word-quicklycommand">
<zh-CN>快捷启动命令</zh-CN>
@@ -775,6 +779,10 @@
<zh-CN>你确定你要停止它吗?</zh-CN>
<en-US>Are you sure you want to stop it?</en-US>
</lang>
<lang id="copy">
<zh-CN>你确定要复制它吗?</zh-CN>
<en-US>Are you sure you want to copy it?</en-US>
</lang>
</confirm>
<reply>
+2 -2
View File
@@ -34,7 +34,7 @@
<div class="form-group" id="client_id">
<label class="control-label font-bold" langtag="word-clientid"></label>
<div class="col-sm-10">
<select class="form-control" name="client_id" placeholder=""
<select class="form-control" name="client_id" placeholder="" id="nps_client_id"
langtag="word-belongclient"></select>
<!-- <input value="{{.client_id}}" class="form-control" type="text" name="client_id"-->
@@ -187,7 +187,7 @@
var option = "<option value=\"" + data.rows[i].Id + "\"";
option += ">" + data.rows[i].Id + '-' + data.rows[i].Remark + "</option>"; //动态添加数据
$("select[name='client_id']").append(option);
$("select[name='client_id']").find("option[value='{{.t.Client.Id}}']").attr("selected", true);
$("select[name='client_id']").find("option[value='{{.client_id}}']").attr("selected", true);
}
}
}
+7 -2
View File
@@ -76,7 +76,7 @@
+ '<b langtag="word-compress"></b>: ' + row.Client.Cnf.Compress + '&emsp;'
+ '<b langtag="word-basicusername"></b>: ' + row.Client.Cnf.U + '&emsp;'
+ '<b langtag="word-basicpassword"></b>: ' + row.Client.Cnf.P + '&emsp;'
+ '<b langtag="word-ishttp"></b>: ' + row.IsHttp + '&emsp;'
+ '<b langtag="word-protoversion"></b>: ' + row.ProtoVersion + '&emsp;'
if (row.Mode == "p2p") {
return tmp + "<br/><br>"
+ '<b langtag="word-commandaccessp2p"></b>: ' + "<code>./npc{{.win}} -server={{.ip}}:{{.p}} -vkey=" + row.Client.VerifyKey
@@ -215,6 +215,7 @@
title: '<span langtag="word-option"></span>',//内容
align: 'center',
halign: 'center',
width: '200px',
visible: true,//false表示不显示
formatter: function (value, row, index) {
btn_group = '<div class="btn-group">'
@@ -227,8 +228,12 @@
}
btn_group += "<a onclick=\"submitform('delete', '{{.web_base_url}}/index/del', {'id':" + row.Id
btn_group += '})" class="btn btn-outline btn-danger"><i class="fa fa-trash"></i></a>'
btn_group += '<a href="{{.web_base_url}}/index/edit?id=' + row.Id
btn_group += '" class="btn btn-outline btn-success"><i class="fa fa-edit"></i></a></div>'
btn_group += '" class="btn btn-outline btn-success"><i class="fa fa-edit"></i></a>'
btn_group += "<a onclick=\"submitform('copy', '{{.web_base_url}}/index/copy', {'id':" + row.Id
btn_group += '})" class="btn btn-outline btn-primary"><i class="fa fa-copy"></i></a></div>'
return btn_group
}
}