Rafostar / clapper

Level up your video experience with a modern and user-friendly media player.
https://rafostar.github.io/clapper/
GNU General Public License v3.0
773 stars 36 forks source link

Websocket not available over network? #362

Closed peteruithoven closed 1 year ago

peteruithoven commented 1 year ago

I'm trying to make a very simple remote website using the websocket that I could use from my phone to control Clapper on my laptop. Both on the laptop itself using ws://localhost:6446/websocket works fine, but going through the network, using the ip of my laptop (ws://192.168.178.144:6446/websocket) doesn't seem to work. Also not on this public websockets test page.

Any change the websocket (port) isn't exposed on the network?

I'm running Clapper using Flatpak, could that be the issue?

Current code: https://stackblitz.com/edit/js-uiw7vp?file=index.js

Rafostar commented 1 year ago

Yes, it was by mistake set to not listen on all interfaces. Now fixed.

You can try Flatpak build from here with the merged fix.

One thing to note, web browsers do not allow insecure connections from HTTPS (HTTPS -> WS), so we either need to add an option to Clapper to support setting user certificates to enable WSS (if you wish for such a feat, please open separate feature request), alternatively you could host your web page as plain HTTP, or you can temporarily workaround this in Firefox by enabling network.websocket.allowInsecureFromHTTPS in about:config.

peteruithoven commented 1 year ago

Thanks!