Carry game traffic over the HTTP port; support HTTPS/wss - #35
Merged
Conversation
- Apache mod_proxy_wstunnel routes websocket upgrades on port 80 to the internal game server, so one published port serves page, assets, and game - Patch ioquake3.js at build time: scheme-relative asset URLs and protocol-conditional ws/wss, making the client work behind TLS termination - Entrypoint bakes origin-adaptive host/port expressions into index.html; HTTP_PORT is removed (page now works from any host, port, or scheme) - Drop the 27960 port mapping from compose; direct publish remains optional - Build fails fast if the engine patches stop matching upstream Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 13, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mod_proxy_wstunnelnow proxies websocket-upgrade requests on port 80 to the internal game server on 27960, so the published HTTP port carries the page, assets, and game connection. The27960:27960mapping is gone from compose (publishing it directly remains possible for anything that wants the raw socket).ioquake3.jsis patched at build time — asset URLs become scheme-relative and the game websocket useswss://when the page is HTTPS — so the game is fully playable behind a TLS-terminating reverse proxy. Build fails fast (grepguards) if upstream changes make the patches stop matching.window.location-based expressions intoindex.html, so the client follows whatever host/port/scheme the browser used. TheHTTP_PORTenv var is removed (breaking change for anyone who set it; it's simply unnecessary now).Testing
Built and ran with only
-p 18080:80published: healthcheck healthy,curlwebsocket handshake through 18080 returns101 Switching Protocolswith thebinarysubprotocol, and a real browser session loads q3dm1 and spawns in-game — connection line readsCONNECTING TO LOCALHOST:18080.🤖 Generated with Claude Code