README.md
August 19, 2025 Β· View on GitHub
ApFree WiFiDog
A High-Performance Captive Portal Solution for HTTP(S) on OpenWrt
π English | π¨π³ δΈζ | π Auth Server API
π Introduction
ApFree WiFiDog is an open-source, high-performance captive portal for HTTP and HTTPS, tailored for the OpenWrt platform.
It provides secure authentication, high concurrency handling, and flexible rule management for Wi-Fi networks.
π¬ Introduction Video
π Features
- Stable β API-based iptables integration, thread-safe.
- Fast β Built with libevent2 + epoll, far outperforms original WiFiDog.
- Secure β Full HTTPS redirection support.
- Real-time β Long connection support (WebSocket, MQTT).
- Flexible β Local + Cloud authentication, splash page mode.
- Dynamic Rules β Manage MAC, IP, domains without restart.
- eBPF Support β Traffic control & DPI via eBPF.
- Active Community β Fast responses and continuous updates.
π¦ Installation
On OpenWrt (latest):
apk update
apk add apfree-wifidog
On older OpenWrt:
opkg update
opkg install apfree-wifidog
π For LuCI Web Interface, see LuCI Integration.
π₯οΈ LuCI Integration
- ApFree WiFiDog provides a LuCI Web UI via
luci-app-apfree-wifidog. - Integrated in the luci repo.
π‘ Recommended: use chawrt,
which bundles ApFree WiFiDog + LuCI for a ready-to-use OpenWrt firmware.
βοΈ Basic Usage Example
1. Cloud Authentication Mode
- Requires external auth server.
- Configure via LuCI:
Auth Server(Hostname, Port, Path) +Gateway Interface. - Enable WebSocket Support for real-time status.
2. Local Authentication (Splash Page)
- No external auth server needed.
- Configure LuCI:
Gateway Interface+ Redirect URL (welcome / terms page). - Simple click-to-continue or custom splash page.
π οΈ Troubleshooting
Logs
- Check via:
logread - Increase debug level in
wifidogx.confβDaemonLogLevel 7.
Common Issues
- No redirection β check
GatewayInterface, firewall rules, DNS. - Sites blocked β update trusted domains via
wdctlx show domain. - Device issues β check MAC lists (
wdctlx show mac).
Useful wdctlx Commands
wdctlx status client # Show authenticated clients
wdctlx show domain # Show trusted domains
wdctlx add domain example.com
wdctlx apfree user_list # List online users
π¬ Technical Overview
- Event-driven architecture (
libevent2) for massive concurrency. - Firewall integration via
iptables(with nftables support). - Auth flow: Redirect β Auth Server β Firewall update β Internet access.
π See Auth Server API for protocol details.
π€ Contributing
We welcome contributions!
- Submit issues: GitHub Issues
- Pull requests: GitHub PRs
- Guidelines: CONTRIBUTING.md
π¬ Contact
- QQ Group: 331230369