Skip to content

Fix VPN routing/DNS, ping latency display, and add user portal#15

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-panel-server-client-bugs
Draft

Fix VPN routing/DNS, ping latency display, and add user portal#15
Copilot wants to merge 2 commits intomainfrom
copilot/fix-panel-server-client-bugs

Conversation

Copy link

Copilot AI commented Feb 25, 2026

Users reported that VPN connections showed as established but no sites loaded, config selection showed misleading 0ms pings as "fastest", and there was no self-service portal for clients to access their configs.

Server — V2Ray client config (server/protocols/v2ray.py)

  • Added dns block (8.8.8.8, 1.1.1.1, 8.8.4.4) to generated client Xray config — previously absent, causing DNS failures through the tunnel
  • Replaced geosite:cn/geoip:cn routing rules with explicit RFC-1918 CIDR bypass; geo-data files are not bundled with the Windows client, making these rules silently inert
  • Changed domainStrategy from AsIsIPIfNonMatch
# Before — fails silently without geo files on client
"routing": {
    "domainStrategy": "AsIs",
    "rules": [
        {"type": "field", "outboundTag": "direct", "domain": ["geosite:cn", "geosite:private"]},
        {"type": "field", "outboundTag": "direct", "ip": ["geoip:cn", "geoip:private"]}
    ]
}

# After — works everywhere, no file dependencies
"dns": {"servers": ["8.8.8.8", "1.1.1.1", "8.8.4.4"]},
"routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [{"type": "field", "outboundTag": "direct",
               "ip": ["127.0.0.0/8", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]}]
}

Server — Missing logger (server/routes/panel_api.py)

  • Added import logging and logger = logging.getLogger(...) — was causing NameError crashes on core start/stop/restart error paths.

Client — Ping accuracy (client/services/api.ts, client/components/ProfilesPage.tsx)

  • PingAllProfiles previously called /ping-all which returned latency: 0 for every running protocol (server only checks process state, not connectivity). Replaced with parallel real ICMP pings via the native measure_latency Tauri command.
  • Sort, display badges, stats counter, and auto-pilot selection now treat latency === 0 as unmeasured rather than "fastest". Only latency > 0 results participate in ranking.

Web Panel — User portal (web-panel/pages/UserPortalPage.tsx, web-panel/App.tsx, web-panel/components/Sidebar.tsx)

New self-service portal at /candyconnect/user — no admin credentials required. Uses existing /client-api endpoints.

Features:

  • Client login (username + password)
  • Account dashboard: traffic usage progress bar, expiry date, last connection IP
  • Per-config actions: copy VLESS/VMess/Trojan links, download WireGuard .conf, download OpenVPN .ovpn, display L2TP/IKEv2 server+credentials
  • Admin sidebar gains a "User Portal" external link for easy sharing with end users

Portal is activated by path detection (window.location.pathname.includes('/user')); the existing SPA catch-all in server/main.py already serves index.html for all /candyconnect/* paths.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: AmiRCandy <141684579+AmiRCandy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix bugs in panel, server, and client Fix VPN routing/DNS, ping latency display, and add user portal Feb 25, 2026
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.

2 participants