24 lines
673 B
Python
24 lines
673 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
Simple HTTP Web Server for VPN Proxy Control
|
|
Provides a web UI to manage sing-box subscriptions
|
|
"""
|
|
|
|
import socketserver
|
|
from app.config import PORT
|
|
from app.api import ProxyControlHandler
|
|
|
|
class ThreadingHTTPServer(socketserver.ThreadingTCPServer):
|
|
allow_reuse_address = True
|
|
|
|
def main():
|
|
"""Start the web server"""
|
|
# Use ThreadingTCPServer for concurrent requests
|
|
with ThreadingHTTPServer(("", PORT), ProxyControlHandler) as httpd:
|
|
print(f"[WebUI] Server started on port {PORT}")
|
|
print(f"[WebUI] Open http://localhost:{PORT} in your browser")
|
|
httpd.serve_forever()
|
|
|
|
if __name__ == "__main__":
|
|
main()
|