增加代理方式的打洞,进行tcp的转发

This commit is contained in:
2025-10-28 19:33:20 +08:00
parent c48c85f075
commit 2f4097b697
9 changed files with 236 additions and 67 deletions

View File

@@ -40,20 +40,20 @@ func (c *ControllerV1) Update(ctx context.Context, req *v1.UpdateReq) (res *v1.U
}
}
//更新文件
err = service.System().Update(ctx)
type DataType struct {
File []byte `json:"file"`
Name string `json:"name"`
}
//var GatewayMessage *p2p.GatewayMessage
var msgData = struct {
Files []*DataType `json:"files"`
}{}
msgData.Files = []*DataType{}
files, _ := gfile.ScanDir("download", ".*gz")
files, _ := gfile.ScanDir("download", "*.gz")
for _, v := range files {
msgData.Files = append(msgData.Files, &DataType{
@@ -63,5 +63,8 @@ func (c *ControllerV1) Update(ctx context.Context, req *v1.UpdateReq) (res *v1.U
}
service.P2P().SendAll("update", msgData)
//更新自己的文件
//err = service.System().Update(ctx)
return
}