initial commit

This commit is contained in:
2026-03-22 05:17:01 +00:00
parent 9a41fa4ef2
commit ef6e94958a
155 changed files with 43839 additions and 0 deletions

22
serve.py Normal file
View File

@@ -0,0 +1,22 @@
import http.server
import socket
import sys
def get_local_ip():
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s:
s.connect(("8.8.8.8", 80))
return s.getsockname()[0]
port = int(sys.argv[1]) if len(sys.argv) > 1 else 8000
ip = get_local_ip()
handler = http.server.SimpleHTTPRequestHandler
server = http.server.HTTPServer(("0.0.0.0", port), handler)
print(f"Serving on:")
print(f" http://localhost:{port}")
print(f" http://{ip}:{port}")
print("Press Ctrl+C to stop.")
server.serve_forever()