From 0bd6b3971c3af5ec1d54aeaf2f8f61009bbac08f Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Wed, 26 Oct 2022 07:33:27 -0600 Subject: [PATCH] Work with config --- docker/rootfs/etc/services.d/go2rtc/run | 2 +- docker/rootfs/usr/local/go2rtc/go2rtc.yaml | 2 -- docker/rootfs/usr/local/go2rtc/sbin/go2rtc.yaml | 2 ++ docker/rootfs/usr/local/nginx/conf/nginx.conf | 6 ++++++ web/src/components/WebRtcPlayer.jsx | 1 + 5 files changed, 10 insertions(+), 3 deletions(-) delete mode 100644 docker/rootfs/usr/local/go2rtc/go2rtc.yaml create mode 100644 docker/rootfs/usr/local/go2rtc/sbin/go2rtc.yaml diff --git a/docker/rootfs/etc/services.d/go2rtc/run b/docker/rootfs/etc/services.d/go2rtc/run index 2cf0dd347..04b6a047b 100644 --- a/docker/rootfs/etc/services.d/go2rtc/run +++ b/docker/rootfs/etc/services.d/go2rtc/run @@ -1,2 +1,2 @@ #!/usr/bin/execlineb -P -/usr/local/go2rtc/sbin/go2rtc -config=/usr/local/go2rtc/go2rtc.yaml \ No newline at end of file +/usr/local/go2rtc/sbin/go2rtc -config=./go2rtc.yaml \ No newline at end of file diff --git a/docker/rootfs/usr/local/go2rtc/go2rtc.yaml b/docker/rootfs/usr/local/go2rtc/go2rtc.yaml deleted file mode 100644 index 89023e4a0..000000000 --- a/docker/rootfs/usr/local/go2rtc/go2rtc.yaml +++ /dev/null @@ -1,2 +0,0 @@ -webrtc: - listen: ":8555 diff --git a/docker/rootfs/usr/local/go2rtc/sbin/go2rtc.yaml b/docker/rootfs/usr/local/go2rtc/sbin/go2rtc.yaml new file mode 100644 index 000000000..f2d9faa8e --- /dev/null +++ b/docker/rootfs/usr/local/go2rtc/sbin/go2rtc.yaml @@ -0,0 +1,2 @@ +webrtc: + listen: ":8555" diff --git a/docker/rootfs/usr/local/nginx/conf/nginx.conf b/docker/rootfs/usr/local/nginx/conf/nginx.conf index d06ce4d55..ff3c36b5a 100644 --- a/docker/rootfs/usr/local/nginx/conf/nginx.conf +++ b/docker/rootfs/usr/local/nginx/conf/nginx.conf @@ -170,6 +170,12 @@ http { proxy_set_header Host $host; } + location /go2rtc { + proxy_pass http://go2rtc/; + proxy_http_version 1.1; + proxy_set_header Host $host; + } + location /live/jsmpeg/ { proxy_pass http://jsmpeg/; proxy_http_version 1.1; diff --git a/web/src/components/WebRtcPlayer.jsx b/web/src/components/WebRtcPlayer.jsx index 5397717d8..37d46fe03 100644 --- a/web/src/components/WebRtcPlayer.jsx +++ b/web/src/components/WebRtcPlayer.jsx @@ -17,6 +17,7 @@ export default function WebRtcPlayer({ camera, width, height }) { } ws.onmessage = ev => { const msg = JSON.parse(ev.data); + console.log("For fun " + msg.type + " and a message " + msg.value); if (msg.type === 'webrtc/candidate') { pc.addIceCandidate({candidate: msg.value, sdpMid: ''});