#!/usr/bin/env python3
# Minimal HTTP server for the WebUSB POC.
# WebUSB requires a secure context — http://localhost is treated as secure.
import http.server
import socketserver
import os

PORT = 8080
os.chdir(os.path.dirname(os.path.abspath(__file__)))

class Handler(http.server.SimpleHTTPRequestHandler):
    def end_headers(self):
        self.send_header("Cache-Control", "no-store")
        super().end_headers()

socketserver.TCPServer.allow_reuse_address = True
with socketserver.TCPServer(("127.0.0.1", PORT), Handler) as httpd:
    print(f"Serving POC on http://127.0.0.1:{PORT}/poc.html")
    httpd.serve_forever()
