go2rtc icon indicating copy to clipboard operation
go2rtc copied to clipboard

How to stream on static html?

Open newnew01 opened this issue 9 months ago • 5 comments

streams:
    my_cam1: rtsp://admin:[email protected]:10554/tcp/av0_0
    my_cam2: rtsp://admin:[email protected]:554/onvif1

api:
  origin: "*"

webrtc:
  listen: ":8555"

I have ip camera with rtsp protocol stream to go2rtc binary version. It work fine on web backend (http://localhost:1984/). how to put the webrtc streaming on external html page?

newnew01 avatar Apr 02 '25 10:04 newnew01

You should open public access to go2rtc API server. For security reasons, I recommend using some sort of reverse proxy, like nginx, and only proxy selected URLs. Because the go2rtc API is not designed to directly work publicly without authorization. Yet.

AlexxIT avatar Apr 02 '25 11:04 AlexxIT

You should open public access to go2rtc API server. For security reasons, I recommend using some sort of reverse proxy, like nginx, and only proxy selected URLs. Because the go2rtc API is not designed to directly work publicly without authorization. Yet.

Ok, I just use for private LAN network so I don't have security concern. I dig a bit more and found that I have to use api, right? to connect something like ws://localhost:1984/api/ws?src=my_cam1 (web socket?)

what about webrtc port 8555? what is the reason for this?

newnew01 avatar Apr 02 '25 11:04 newnew01

For private network you can use iframe or direct link to html with player.

About WebRTC check docs.

AlexxIT avatar Apr 02 '25 13:04 AlexxIT

Hi, if I wanted to put up a publicly viewable camera via go2rtc, is there a way I could permit access to the stream.html side of things, yet prevent the API interface from potentially leaking camera credentials? Many thanks in advance

electrocamuk avatar Dec 17 '25 21:12 electrocamuk

No. Go2rtc's basic functionality is designed for private use only. You need to develop your own public API that will hide private data. Perhaps access rights will appear in future versions.

AlexxIT avatar Dec 18 '25 09:12 AlexxIT