1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

WebRTC: Extract SrsRtcNetwork layer for UDP/TCP.

This commit is contained in:
winlin 2022-09-03 11:52:11 +08:00
parent 770d959148
commit 625069af7f
23 changed files with 698 additions and 528 deletions

View file

@ -116,6 +116,7 @@ auto_reload_for_docker on;
# the rtmp listen ports, split by space, each listen entry is <[ip:]port>
# for example, 192.168.1.100:1935 10.10.10.100:1935
# where the ip is optional, default to 0.0.0.0, that is 1935 equals to 0.0.0.0:1935
# Overwrite by env SRS_LISTEN
listen 1935;
# the default chunk size is 128, max is 65536,
# some client does not support chunk size change,
@ -135,12 +136,14 @@ chunk_size 60000;
# where the cli can only be used in shell/terminate.
http_api {
# whether http api is enabled.
# Overwrite by env SRS_HTTP_API_ENABLED
# default: off
enabled on;
# The http api listen entry is <[ip:]port>, For example, 192.168.1.100:8080, where the ip is optional, default to
# 0.0.0.0, that is 8080 equals to 0.0.0.0:8080.
# Note that you're able to use a dedicated port for HTTP API, such as 1985, to be different with HTTP server. In
# this situation, you you must also set another HTTPS API port.
# Overwrite by env SRS_HTTP_API_LISTEN
# Default: 1985
listen 8080;
# whether enable crossdomain request.
@ -164,11 +167,13 @@ http_api {
# For https_api or HTTPS API.
https {
# Whether enable HTTPS API.
# Overwrite by env SRS_HTTP_API_HTTPS_ENABLED
# default: off
enabled on;
# The listen endpoint for HTTPS API.
# Note that you're able to use a dedicated port for HTTPS API, such as 1990, and the HTTP API should not be
# the same of HTTP server(8080) neither.
# Overwrite by env SRS_HTTP_API_HTTPS_LISTEN
# Default: 1990
listen 8088;
# The SSL private key file, generated by:
@ -193,12 +198,14 @@ http_api {
# need to open the feature http of vhost.
http_server {
# whether http streaming service is enabled.
# Overwrite by env SRS_HTTP_SERVER_ENABLED
# default: off
enabled on;
# the http streaming listen entry is <[ip:]port>
# for example, 192.168.1.100:8080
# where the ip is optional, default to 0.0.0.0, that is 8080 equals to 0.0.0.0:8080
# @remark, if use lower port, for instance 80, user must start srs by root.
# Overwrite by env SRS_HTTP_SERVER_LISTEN
# default: 8080
listen 8080;
# the default dir for http root.
@ -211,9 +218,11 @@ http_server {
# For https_server or HTTPS Streaming.
https {
# Whether enable HTTPS Streaming.
# Overwrite by env SRS_HTTP_SERVER_HTTTPS_ENABLED
# default: off
enabled on;
# The listen endpoint for HTTPS Streaming.
# Overwrite by env SRS_HTTP_SERVER_HTTTPS_LISTEN
# default: 8088
listen 8088;
# The SSL private key file, generated by:
@ -297,9 +306,11 @@ vhost srt.vhost.srs.com {
#############################################################################################
rtc_server {
# Whether enable WebRTC server.
# Overwrite by env SRS_RTC_SERVER_ENABLED
# default: off
enabled on;
# The udp listen port, we will reuse it for connections.
# Overwrite by env SRS_RTC_SERVER_LISTEN
# default: 8000
listen 8000;
# For WebRTC over TCP directly, not TURN, see https://github.com/ossrs/srs/issues/2852
@ -329,11 +340,13 @@ rtc_server {
# x.x.x.x A specified IP address or DNS name, use * if 0.0.0.0.
# @remark For Firefox, the candidate MUST be IP, MUST NOT be DNS name, see https://bugzilla.mozilla.org/show_bug.cgi?id=1239006
# @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate
# Overwrite by env SRS_RTC_SERVER_CANDIDATE
# default: *
candidate *;
# If candidate is * or 0.0.0.0, means SRS could detect IP automatically, filtered by ip_family.
# You can config this to off to disable the detecting, then SRS will try to parse the API hostname.
# Note that browser might fail if no CANDIDATE specified.
# Overwrite by env SRS_RTC_SERVER_USE_AUTO_DETECT_NETWORK_IP
# Default: on
use_auto_detect_network_ip on;
# The IP family filter for auto discover candidate, it can be:
@ -341,20 +354,24 @@ rtc_server {
# ipv6 Filter IP v6 candidates.
# all Filter all IP v4 or v6 candidates.
# For example, if set to ipv4, we only use the IPv4 address as candidate.
# Overwrite by env SRS_RTC_SERVER_IP_FAMILY
# default: ipv4
ip_family ipv4;
# If api_as_candidates is on, SRS would try to use the IP of api server, specified by srs.sdk.js request:
# api:string "http://r.ossrs.net:1985/rtc/v1/play/"
# in this case, the r.ossrs.net and 39.107.238.185 will be added as candidates.
# Overwrite by env SRS_RTC_SERVER_API_AS_CANDIDATES
# Default: on
api_as_candidates on;
# If use api as CANDIDATE, whether resolve the api hostname.
# Note that use original domain name as CANDIDATE, which might make Firefox failed, see https://bugzilla.mozilla.org/show_bug.cgi?id=1239006
# Note that if hostname is IPv4 address, always directly use it.
# Overwrite by env SRS_RTC_SERVER_RESOLVE_API_DOMAIN
# Default: on
resolve_api_domain on;
# If use api as CANDIDATE, whether keep original api domain name as CANDIDATE.
# Note that use original domain name as CANDIDATE, which might make Firefox failed, see https://bugzilla.mozilla.org/show_bug.cgi?id=1239006
# Overwrite by env SRS_RTC_SERVER_KEEP_API_DOMAIN
# Default: off
keep_api_domain off;
# Whether use ECDSA certificate.
@ -390,6 +407,7 @@ rtc_server {
vhost rtc.vhost.srs.com {
rtc {
# Whether enable WebRTC server.
# Overwrite by env SRS_VHOST_RTC_ENABLED for all vhosts.
# default: off
enabled on;
# Whether support NACK.
@ -420,6 +438,7 @@ vhost rtc.vhost.srs.com {
###############################################################
# Whether enable transmuxing RTMP to RTC.
# If enabled, transcode aac to opus.
# Overwrite by env SRS_VHOST_RTC_RTMP_TO_RTC for all vhosts.
# default: off
rtmp_to_rtc off;
# Whether keep B-frame, which is normal feature in live streaming,
@ -428,6 +447,7 @@ vhost rtc.vhost.srs.com {
keep_bframe off;
###############################################################
# Whether enable transmuxing RTC to RTMP.
# Overwrite by env SRS_VHOST_RTC_RTC_TO_RTMP for all vhosts.
# Default: off
rtc_to_rtmp off;
# The PLI interval in seconds, for RTC to RTMP.