This is a simple integrated repository containing a set of frontend HTML single-file components, an SRS configuration file, and a few lines of Caddyfile configuration. This setup uses Caddy as the HTTP and reverse proxy service, and SRS for backend stream processing.
- Install the necessary packages, including Caddy and SRS, in your own way. We recommend running SRS inside a Docker container using the command below.
- Copy the contents of the
Caddyfileto your own Caddyfile, and copysrs.confto your~/srs-configfolder. Create the folder if it doesn't exist. - Copy the
wwwfolder or its contents to your ownwwwfolder or website directory for HTTP serving. - Now run Caddy, and execute this Docker command:
docker run --rm -it \ -p 1935:1935 \ -p 1985:1985 \ -p 23456:8080 \ -p 8000:8000/udp \ --env CANDIDATE=$CANDIDATE \ -v ~/srs-config/srs.conf:/usr/local/srs/conf/srs.conf \ registry.cn-hangzhou.aliyuncs.com/ossrs/srs:6 \ ./objs/srs -c conf/srs.conf - Open your streaming tool (such as
ffmpegorOBS). In Settings → Stream, select the platform asCustom, and fill in the URL in this format:rtmp://[YOUR_DOMAIN]/live/[ANY_NAME]. Feel free to fill in the stream key. Then return to the website, and you will find your stream in the list under the player.
-
Why does the low-latency page seem so laggy?
- Because that page uses WebRTC for streaming, but there are too many compatibility issues that make the experience suboptimal. We still recommend using the HLS player in
index.html.
- Because that page uses WebRTC for streaming, but there are too many compatibility issues that make the experience suboptimal. We still recommend using the HLS player in
-
Why do we need Caddy as a reverse proxy?
- To solve simple CORS issues.
-
What effect does the Stream Key have here?
- The key will continue the server URL as a unique identifier. For example, the path you enter after
/live/(e.g.,rtmp://live.example.com/live/qwe) combined with the keyasdwill form the streaming URLrtmp://live.example.com/live/qwe/asdfor the player to fetch.
- The key will continue the server URL as a unique identifier. For example, the path you enter after