Add Caddy server configuration for domain markov.elpatron.me with Let's Encrypt SSL and WebSocket support. Includes: - Caddy service in docker-compose.yml - Caddyfile with SSL and WebSocket configuration - Enhanced Flask app for proxy compatibility - Documentation files (CADDY.md, updated README.md)

This commit is contained in:
2025-08-25 20:28:41 +00:00
parent 70bde3c015
commit b016d83c2f
5 changed files with 194 additions and 6 deletions

View File

@@ -21,7 +21,10 @@ socketio = SocketIO(
transports=['websocket', 'polling'],
# Ping settings for better connection detection
ping_timeout=60,
ping_interval=25
ping_interval=25,
# Proxy compatibility settings
allow_upgrades=True,
upgrade_timeout=30
)
# Global simulation manager instance
@@ -44,6 +47,10 @@ def create_app(config_name=None):
app = Flask(__name__)
app.config.from_object(config[config_name])
# Configure for reverse proxy
from werkzeug.middleware.proxy_fix import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1)
# Initialize extensions with proxy-friendly settings
socketio.init_app(
app,
@@ -52,7 +59,9 @@ def create_app(config_name=None):
allow_upgrades=True,
transports=['websocket', 'polling'],
ping_timeout=60,
ping_interval=25
ping_interval=25,
upgrade_timeout=30,
manage_session=False # Important for proxy compatibility
)
# Register blueprints