proxy/docs/proxy-usage.md
When running the project for testing or development, you should:
make && env PROXY_RTMP_SERVER=1935 PROXY_HTTP_SERVER=8080 \
PROXY_HTTP_API=1985 PROXY_WEBRTC_SERVER=8000 PROXY_SRT_SERVER=10080 \
PROXY_SYSTEM_API=12025 PROXY_LOAD_BALANCER_TYPE=memory ./srs-proxy
The proxy server should start and listen on the configured ports.
In a new terminal, start the SRS origin server. You may need to increase the file descriptor limit and use bash explicitly:
ulimit -n 10000 && bash -c "cd ~/git/srs/trunk && ./objs/srs -c conf/origin1-for-proxy.conf"
The SRS origin server should start and be ready to receive and serve streams. Check the console output for startup messages.
Check the proxy logs to confirm SRS has registered itself with the proxy:
The proxy logs are printed to the console where you started the proxy server. Check the terminal running the proxy for messages indicating:
The SRS origin server should automatically register itself with the proxy when it starts. Look for successful registration messages in proxy console outputs.
In a new terminal, publish a test stream using FFmpeg:
ffmpeg -stream_loop -1 -re -i ~/git/srs/trunk/doc/source.flv -c copy -f flv rtmp://localhost/live/livestream
Note:
-stream_loop -1makes FFmpeg loop the input file infinitely, ensuring the stream doesn't quit after the file ends.
In another terminal, use ffprobe to verify the stream is working:
Test RTMP stream:
ffprobe rtmp://localhost/live/livestream
Test HTTP-FLV stream:
ffprobe http://localhost:8080/live/livestream.flv
Both commands should successfully detect the stream and display video/audio codec information. If ffprobe shows stream details without errors, the proxy is working correctly.
NewBootstrap(), NewMemoryLoadBalancer(), etc.New() function names// Good
bs := bootstrap.NewBootstrap()
// Avoid
bs := bootstrap.New()