mirror of
https://github.com/ayflying/p2p.git
synced 2026-03-05 01:39:23 +00:00
增加代理方式的打洞,进行tcp的转发
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user