Skip to content

Conversation

ttimasdf
Copy link

@ttimasdf ttimasdf commented Jun 13, 2025

  1. 添加获取公网IP功能,默认关闭,保护用户隐私
  2. 添加两个provider,ip.sb(国外)vv.video.qq.com(国内),后续可通过 IExternalIpProvider 扩展其他接口。(挂代理的用户可以用国内的API获取正确的本机地址,ref: ”查看外网IP地址“ 功能增强 TrafficMonitor#516 建议获取外网 IP 的功能使用国内的服务 TrafficMonitor#319
  3. 设置界面中添加对应配置选项。
    image
  4. 为内网IP添加自动更新功能,与公网IP以相同的时间间隔更新。

@ttimasdf
Copy link
Author

目前只适配并测试了 IPv4,暂未适配 IPv6,不知道有没有需求。

@ttimasdf
Copy link
Author

发现插件的定时 poll 函数全都在主线程中被调用的,在主线程中发起 http 请求的时候,如果网络阻塞就会把界面卡死。

得像 Weather 插件一样放到线程里面

@ttimasdf
Copy link
Author

ttimasdf commented Jun 13, 2025

我发现目前LAN IP好像没有自动更新的机制,可能获取adapter是一个比较重的操作,既然线程机制都实现了,干脆一起加上算了吧

不过这里有个 design choice,就是要不要分别指定LAN IP和WAN IP的更新间隔,如果LAN IP和WAN IP更新间隔相同,那就一个线程全搞定,简单,否则就要写两个线程,代码写两份。

Related issue #114

@ttimasdf
Copy link
Author

LAN和WAN的地址获取写进一个线程了。用 semophere 大概能保证两个 item 同时调用的时候,也只触发一次更新。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant