iamdb / hifi.rs

a high resolution Qobuz streamer built in Rust
GNU General Public License v3.0
71 stars 10 forks source link

feat: use wss:// when accessed through HTTPS #249

Closed rarescosma closed 5 months ago

rarescosma commented 6 months ago

First of all thank you very much for this project.

Found it after hours of hair-pulling trying to set up qobuz player through a KVM windoze virtual machine just to get gapless playback.

The PR addresses a small issue I've encountered in my local setup when trying to use HTTPS through a reverse-proxy. The websockets protocol was hardcoded to ws://, which when accessed through HTTPS will trigger a DOMException: The operation is insecure. error in the browser.

This is a simple fix to dynamically set the proper protocol: ws:// on plain HTTP, wss:// on HTTPS.

iamdb commented 5 months ago

Thank you!