How samaliyan/iptray works
IPTray is a Windows tray application for monitoring public IP, geolocation, and VPN/proxy state. Its main workflow is the app's fetch loop: choose a network route, query IP-check endpoints, resolve location, apply user corrections, and update the tray badge and notifications. The README also documents settings, network-triggered refresh, IPv6 leak hints, and diagnostics. Source excerpts establish several core calls; some UI and event wiring is unsampled, so those relationships are omitted or marked unverified.
Main entry points: main.go Tray app and fetch loop · diag.go Route diagnostics · lookup.go Location consensus · logic.go Route and notification logic
Components 22
Tray application
- Tray app and fetch loop
main.go - Badge rendering
icon.go - Route diagnostics
diag.go - Diagnostic report
Network and lookup
- IP consensus
lookup.go - Location consensus
lookup.go - Location cache
lookup.go - Built-in HTTP fetcher
lookup.go
Settings and decisions
- Settings
config.go - Route and notification logic
logic.go - Country names
countries.go
Windows integration
- WinINet fetcher
wininet_windows.go - PAC evaluation
pac_windows.go - Proxy settings
proxy_windows.go - Network change watcher
watch_windows.go - Windows tray UI
win.go - Dark-mode support
darkmode_windows.go - Per-user installer
setup/main.go - Uninstaller
uninstall_windows.go
Other components
- User
- IP-check services
- Geolocation services
Connections 26
- Tray app and fetch loop → Settings: reads settings
- Tray app and fetch loop → Route and notification logic: plans routes
- Tray app and fetch loop → IP consensus: checks IP
- Tray app and fetch loop → Location consensus: locates IP
main.go - Tray app and fetch loop → Windows tray UI: updates tray
- Tray app and fetch loop → Badge rendering: renders badge
main.go - Tray app and fetch loop → Network change watcher: reacts to changes
- IP consensus → IP-check services: queries
lookup.go - Location consensus → Geolocation services: queries
lookup.go - Location consensus → Location cache: stores results
lookup.go - Tray app and fetch loop → WinINet fetcher: uses system route
- Tray app and fetch loop → Built-in HTTP fetcher: uses built-in route
- Route and notification logic → PAC evaluation: plans PAC route
- Route and notification logic → Proxy settings: reads proxy plan
- Route diagnostics → WinINet fetcher: tests routes
diag.go - Route diagnostics → IP-check services: queries endpoints
diag.go - Route diagnostics → Location consensus: locates observed IPs
diag.go - Route diagnostics → PAC evaluation: reports PAC decisions
diag.go - Route diagnostics → Diagnostic report: writes report
diag.go - User → Tray app and fetch loop: uses tray
- User → Route diagnostics: requests diagnosis
README.md - User → Settings: edits settings
README.md - Badge rendering → Country names: shows country
- Windows tray UI → Dark-mode support: applies theme
- Per-user installer → Tray app and fetch loop: installs and starts
setup/main.go - Uninstaller → Tray app and fetch loop: stops instance
uninstall_windows.go