- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.5k
fix: Add DISABLE_HTTPS support for WebSocket URLs in system-config.js #2119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Fix WebSocket connection failures when DISABLE_HTTPS=1 is set - WebSocket URLs now use 'ws://' when HTTPS is disabled and 'wss://' when enabled - Add volume mount for custom web templates to make changes persistent - Include all necessary default templates to ensure container compatibility Resolves WebSocket connection issues in local development environments where HTTPS is disabled but WebSocket was still trying to use WSS protocol. Changes: - docker-compose.yml: Add volume mount for ./web/templates:/defaults - web/templates/system-config.js: Add DISABLE_HTTPS environment variable support - web/templates/: Include all default Jitsi templates for container compatibility
| 
 Please drop any changes other than these 2. | 
| Please change the existing config files to honor the env variable, don't a whole new template logic, that's not acceptable | 
- Add DISABLE_HTTPS environment variable to system-config.js template - Use inline conditionals for ws:// vs wss:// protocol selection in WebSocket URLs - Modify existing WebSocket config lines without adding new template logic Fixes WebSocket connection failures when DISABLE_HTTPS=1 is set by using 'ws://' when HTTPS is disabled and 'wss://' when enabled. Addresses maintainer feedback to modify existing config files rather than adding whole new template logic blocks.
| @saghul Could you please review this updated implementation? I've addressed your feedback by: 
 Thanks! | 
| Hum, hold on. What use case do you have where the client will connect to WS and not WSS? WebRTC only works on secure endpoints and you'd be downgrading the connection there wouldn't you? | 
| @saghul , You are right to call that out, but in our case this is an internal setup over VPN, so WS is sufficient. It's not public facing and all traffic stays within the local network. we tried self-signed certs, but they added overhead and introduced some performance cost. | 
| I see. I fear this would break people's systems. I think a better way to go about this is to use the custom-config.js and override the WebSocket URL there. | 
| @saghul | 
| The thing is, since you need HTTPS in order for WebRTC to work, why do you insist on using WS? There is already a way to override it. Your use case is so niche I see no good reason to add a dedicated option for it, when there is already a way to accomplish what you need. DISABLE_HTTPS=1 is designed for when you are using a reversee proxy, and in that case why are you not proxying the WS connection too? | 
| Thanks for the clarification,  you are absolutely right that  Happy to open a PR if this sounds reasonable. | 

Fix WebSocket connections when HTTPS is disabled
WebSocket connections were failing when
DISABLE_HTTPS=1because the URLs were hardcoded to usewss://.This adds support for the
DISABLE_HTTPSenvironment variable so WebSocket URLs use:ws://when HTTPS is disabledwss://when HTTPS is enabledChanged: Added inline conditionals to
system-config.jsfor protocol selection.