Use subpath in websocket URL - #471
Conversation
Refactor websocket host determination logic to a separate function. Signed-off-by: Ted Kesgar <tkesgar@users.noreply.github.com>
Signed-off-by: Ted Kesgar <tkesgar@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe WebSocket URL construction now uses ChangesWebSocket URL resolution
Mergeability Score: ⚪ Minimal · up to This localized change updates websocket URLs to preserve deployment subpaths, and no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: dependency version conflict. Check your lock file or package.json. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: Ravjot Brar <83892020+ravjotbrar@users.noreply.github.com> Signed-off-by: Ted Kesgar <tkesgar@users.noreply.github.com>
|
One thing to note: users deploying behind a subpath proxy will need to set VALKEY_ADMIN_ALLOWED_WS_ORIGINS to include the proxy's origin (e.g., http://myproxy:9090) |
Slightly adjusts the websocket URL to use subpath. This allows us to support subpath deployments without having to rebuild the frontend:
https://valkey.mywebsite.com/wss://valkey.mywebsite.com/https://mywebsite.com/valkey/wss://mywebsite.com/valkey/Currently we use
ws[s]://window.location.host, which ignores the root path of our subpath deployment even with rewrite in reverse proxy (e.g.https://mywebsite.com/valkey/=>wss://https://mywebsite.com).We can instead derive the websocket URL from
window.location.origin + window.location.pathname, which gives us the full path without hash part or search query.