Sign inSign up

husarnet/webrtc-streamer

By husarnet

•Updated over 5 years ago

WebRTC server + web UI + VPN client. Access a real-time web camera stream over the Internet.

Image
1

1.8K

husarnet/webrtc-streamer repository overview

⁠Requirements

  1. A laptop with Firefox or Chrome web browser
  2. A single board computer (SBC) with connected USB camera - tested on RaspberryPi 4 and Logitech C920 USB web camera
  3. Husarnet VPN Join Code.

You will find your Join Code at https://app.husarnet.com⁠
-> Click on the desired network
-> Add element button
-> Join code tab

It look like this: fc94:b01d:1803:8dd8:b293:5c7d:7639:932a/xxxxxxxxxxxxxxxxxxxxxx

⁠SBC configuration

  1. Save your Husarnet VPN Join Code as an environmental variable:
export HUSARNET_JOINCODE="fc94:b01d:1803:8dd8:b293:5c7d:7639:932a/xxxxxxxxxxxxxxxxxxxxxx"
  1. Start a container:
sudo docker run --rm -it \
--device /dev/video0:/dev/video0  \
--device /dev/snd \
--device /dev/net/tun \
--volume husarnet_webrtc_demo_v:/var/lib/husarnet \
--cap-add NET_ADMIN \
--sysctl net.ipv6.conf.all.disable_ipv6=0 \
--env JOINCODE=${HUSARNET_JOINCODE} \
--env HOSTNAME="my-ip-camera" \
husarnet/webrtc-streamer:latest
  1. Save a link to a web UI hosted by SBC
sudo docker run  ...

...

*******************************************
šŸ’” Tip
To access a live video stream visit:
šŸ‘‰ http://[fc94:77e5:c1a2:4c2c:871a:xxxx:xxxx:xxxx]:80/ šŸ‘ˆ
in your web browser šŸ’»
*******************************************

⁠Laptop configuration

  1. Save your Husarnet VPN Join Code as an environmental variable:
export HUSARNET_JOINCODE="fc94:b01d:1803:8dd8:b293:5c7d:7639:932a/xxxxxxxxxxxxxxxxxxxxxx"
  1. Install Husarnet VPN client:
curl https://install.husarnet.com/install.sh | sudo bash
sudo systemctl restart husarnet
  1. Connect your laptop to the same Husarnet VPN network as SBC, by using the same Husarnet Join Code:
sudo husarnet join ${HUSARNET_JOINCODE} mylaptop
  1. Open the URL provided by the SBC in Firefox or Chrome web browser on your laptop:

WebRTC docker webserver

⁠More Details

The source code: https://github.com/husarnet/webrtc-streamer⁠

Tag summary

Content type

Image

Digest

Size

418.4 MB

Last updated

over 5 years ago

docker pull husarnet/webrtc-streamer