TzuHuanTai / PiCamera.js

WebRTC Connection and Video Stream for Raspberry Pi Camera.
https://www.npmjs.com/package/picamera.js
GNU Affero General Public License v3.0
2 stars 2 forks source link

Connection Closed: 1006 #6

Open thomergil opened 2 weeks ago

thomergil commented 2 weeks ago

When I try to get piCamera.js running (still no luck with that), I'm now to the point where the MQTT connection seems to initially succeed, and then fail. This is Firefox on MacOS. Screenshots attached.

I am connecting to Mosquitto running on port 1884, configured as follows:

listener 1883 localhost
allow_anonymous true

listener 1884
protocol websockets
allow_anonymous true
certfile /etc/mosquitto/certs/mosquitto.crt
keyfile /etc/mosquitto/certs/mosquitto.key

I have previously accepted all self-signed certs in the browser.

Screenshot 2024-11-11 at 3 57 03 PM

Screenshot 2024-11-11 at 3 54 46 PM

Screenshot 2024-11-11 at 3 55 36 PM

thomergil commented 2 weeks ago

If I try everything insecurely over http:// and ws:// (which can only be done when using about:config to set media.devices.insecure.enabled and media.getusermedia.insecure.enabled to true (as per https://stackoverflow.com/questions/60957829/navigator-mediadevices-is-undefined) this problem goes away.

It still doesn't work without SSL (that is, it now asks for microphone and camera access, but the page stays blank), but I wanted to document that this error very likely has something to do with SSL.

The error without SSL is Connection Closed 1005 (rather than 1006).

thomergil commented 2 weeks ago

This problem goes away when I interpose nginx as proxy. So perhaps this is some SSL handshake problem between mosquitto and the client.

thomergil commented 2 weeks ago

https://github.com/TzuHuanTai/PiCamera.js/pull/14 documents how to resolve these issues.