关闭公共节点的链接方式,只连接本地私有节点

This commit is contained in:
2025-10-21 18:47:30 +08:00
parent ab2f099826
commit f4bf11c136
8 changed files with 222 additions and 137 deletions

View File

@@ -20,8 +20,8 @@ import (
)
var (
ctx = gctx.New()
ip string
//ctx = gctx.New()
ip string
)
// 常量定义
@@ -121,6 +121,7 @@ func (s *sP2P) getPublicIPAndType() (ip string, ipType string, err error) {
// 只获取IPv4公网IP过滤IPv6结果
func (s *sP2P) GetIPv4PublicIP() (string, error) {
ctx := gctx.New()
// 优先使用只返回IPv4的API避免IPv6干扰
//client := http.Client{Timeout: 5 * time.Second}