Add HTTP server with CORS support, cookie management, and real-time cookie viewer

This commit is contained in:
2025-02-16 23:32:36 +01:00
parent 28f9d2eedf
commit e2f6f2e82c
4 changed files with 2749 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
from http.server import HTTPServer, SimpleHTTPRequestHandler
class CORSRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header("Access-Control-Allow-Origin", "*") # Permitir solicitudes de cualquier origen
self.send_header("Access-Control-Allow-Methods", "GET, OPTIONS")
self.send_header("Access-Control-Allow-Headers", "X-Requested-With, Content-Type")
super().end_headers()
# Servidor en el puerto 8000
httpd = HTTPServer(("0.0.0.0", 8000), CORSRequestHandler)
print("Servidor corriendo en http://localhost:8000/")
httpd.serve_forever()