增加代理接口

This commit is contained in:
2025-10-30 11:13:47 +08:00
parent 2f4097b697
commit 31d1b3d27e
18 changed files with 274 additions and 104 deletions

View File

@@ -9,6 +9,7 @@ import (
"context"
"github.com/gogf/gf/v2/net/ghttp"
"github.com/gogf/gf/v2/net/gtcp"
"github.com/gorilla/websocket"
"github.com/libp2p/go-libp2p/core/host"
)
@@ -38,7 +39,9 @@ type (
// 只获取IPv4公网IP过滤IPv6结果
GetIPv4PublicIP() (string, error)
ProxyInit()
TcpAck(port int) *gtcp.Conn
Tcp(key string, toPort int, myPort int, ip string)
Http(key string, cname string, toPort int, ip string)
}
)

View File

@@ -15,7 +15,7 @@ type (
Update(ctx context.Context) (err error)
// RestartSelf 实现 Windows 平台下的程序自重启
RestartSelf() error
// RenameRunningFile 重命名正在运行的程序文件(如 p2p.exe → p2p.exe~
// RenameRunningFile 重命名正在运行的程序文件(如 message.exe → message.exe~
RenameRunningFile(exePath string) (string, error)
}
)