From 52746a23cd9f8882deb6c81ee2c40dc075bf1adb Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 24 Jan 2024 11:14:41 +0800 Subject: [PATCH] Update eip for candidate. --- .../current/doc/webrtc.md | 15 +++++++++++++++ .../current/doc/webrtc.md | 14 +++++++++++++- .../version-5.0/doc/webrtc.md | 14 +++++++++++++- versioned_docs/version-5.0/doc/webrtc.md | 17 ++++++++++++++++- 4 files changed, 57 insertions(+), 3 deletions(-) diff --git a/i18n/en-us/docusaurus-plugin-content-docs/current/doc/webrtc.md b/i18n/en-us/docusaurus-plugin-content-docs/current/doc/webrtc.md index f7379d5..32242a8 100644 --- a/i18n/en-us/docusaurus-plugin-content-docs/current/doc/webrtc.md +++ b/i18n/en-us/docusaurus-plugin-content-docs/current/doc/webrtc.md @@ -167,6 +167,17 @@ For each vhost, the configuration is `rtc` section, for example: Please note that `candidate` is essential important, and most failure is caused by wrong `candidate`, so be careful. +The easiest method to modify the `candidate` involves indicating the `eip` in the URL. For instance, if your server +is `192.168.3.10`, utilize this URL: + +* [http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream&eip=192.168.3.10](http://localhost:8080/players/whip.html?eip=192.168.3.10) + +Moreover, the easiest and most direct method to modify the default UDP port `8000`, particularly when it is +behind a load balancer or proxy, involves utilizing the `eip`. For example, if you employ UDP `18000` as the port, +consider using this URL: + +* [http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream&eip=192.168.3.10:18000](http://localhost:8080/players/whip.html?eip=192.168.3.10:18000) + As it shows, `candidate` is server IP to connect to, SRS will response it in SDP answer as `candidate`, like this one: ```bash @@ -324,6 +335,10 @@ curl "http://localhost:1985/rtc/v1/whip/?ice-ufrag=6pk11386&ice-pwd=l91z529147ri > Note: You can replace `http://localhost` with `https://yourdomain.com` to test HTTPS API. +> Note: For SRS Stack, you should specify the secret, so please change the `/rtc/v1/whip?ice-ufrag=` to `/rtc/v1/whip?secret=xxx&ice-ufrag=` as such. + +> Note: You can also use `eip=ip` or `eip=ip:port` to force SRS to use it as the candidate. Please see [CANDIDATE](#config-candidate) for details. + The answer contains the candidate, the UDP server IP, such as `127.0.0.1`: ``` diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/doc/webrtc.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/doc/webrtc.md index a0a9b27..e215309 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/doc/webrtc.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/doc/webrtc.md @@ -152,10 +152,18 @@ vhost rtc.vhost.srs.com { * `rtc.twcc`:是否开启TWCC的支持,即拥塞控制的反馈机制,默认on。 * `rtc.dtls_role`:DTLS角色,active就是DTLS Client(主动发起),passive是DTLS Server(被动接受)。 -## Config: Candidate +## Config Candidate 由于`candidate`特别、特别、特别的重要,大概有1/3的朋友的问题都是这个配置不对。只要`candidate`配置不对,一定会出问题,没有其他可能,是一定会出问题。 +修改`candidate`的最简单方法是在URL中指定`eip`。例如,如果您的服务器是`192.168.3.10`,请使用此URL: + +* [http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream&eip=192.168.3.10](http://localhost:8080/players/whip.html?eip=192.168.3.10) + +此外,修改默认UDP端口`8000`的最简单、最直接方法(尤其是在负载均衡器或代理后面时)是使用`eip`。例如,如果您使用UDP`18000`作为端口,请考虑使用此URL: + +* [http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream&eip=192.168.3.10:18000](http://localhost:8080/players/whip.html?eip=192.168.3.10:18000) + 其实,`candidate`就是服务器的`候选地址`,客户端可以连接的地址`ip:port`,在SDP交换中,就有个`candidate`的信息,比如服务器回的answer可能是这样: ```bash @@ -309,6 +317,10 @@ curl "http://localhost:1985/rtc/v1/whip/?ice-ufrag=6pk11386&ice-pwd=l91z529147ri > Note: 您可以将 `http://localhost` 替换为 `https://yourdomain.com` 以测试 HTTPS API。 +> Note: 对于SRS Stack,您应该指定secret,所以请将`/rtc/v1/whip?ice-ufrag=`更改为`/rtc/v1/whip?secret=xxx&ice-ufrag=`之类的。 + +> Note: 你也可以使用`eip=ip`或者`eip=ip:port`,强制SRS改写candidate的配置。详细请参考 [CANDIDATE](#config-candidate) 的说明。 + 答案包含候选项,即 UDP 服务器 IP,例如 `127.0.0.1`: ``` diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/version-5.0/doc/webrtc.md b/i18n/zh-cn/docusaurus-plugin-content-docs/version-5.0/doc/webrtc.md index 67b511f..8effb24 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/version-5.0/doc/webrtc.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/version-5.0/doc/webrtc.md @@ -152,10 +152,18 @@ vhost rtc.vhost.srs.com { * `rtc.twcc`:是否开启TWCC的支持,即拥塞控制的反馈机制,默认on。 * `rtc.dtls_role`:DTLS角色,active就是DTLS Client(主动发起),passive是DTLS Server(被动接受)。 -## Config: Candidate +## Config Candidate 由于`candidate`特别、特别、特别的重要,大概有1/3的朋友的问题都是这个配置不对。只要`candidate`配置不对,一定会出问题,没有其他可能,是一定会出问题。 +修改`candidate`的最简单方法是在URL中指定`eip`。例如,如果您的服务器是`192.168.3.10`,请使用此URL: + +* [http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream&eip=192.168.3.10](http://localhost:8080/players/whip.html?eip=192.168.3.10) + +此外,修改默认UDP端口`8000`的最简单、最直接方法(尤其是在负载均衡器或代理后面时)是使用`eip`。例如,如果您使用UDP`18000`作为端口,请考虑使用此URL: + +* [http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream&eip=192.168.3.10:18000](http://localhost:8080/players/whip.html?eip=192.168.3.10:18000) + 其实,`candidate`就是服务器的`候选地址`,客户端可以连接的地址`ip:port`,在SDP交换中,就有个`candidate`的信息,比如服务器回的answer可能是这样: ```bash @@ -308,6 +316,10 @@ curl "http://localhost:1985/rtc/v1/whip/?ice-ufrag=6pk11386&ice-pwd=l91z529147ri > Note: 您可以将 `http://localhost` 替换为 `https://yourdomain.com` 以测试 HTTPS API。 +> Note: 对于SRS Stack,您应该指定secret,所以请将`/rtc/v1/whip?ice-ufrag=`更改为`/rtc/v1/whip?secret=xxx&ice-ufrag=`之类的。 + +> Note: 你也可以使用`eip=ip`或者`eip=ip:port`,强制SRS改写candidate的配置。详细请参考 [CANDIDATE](#config-candidate) 的说明。 + 答案包含候选项,即 UDP 服务器 IP,例如 `127.0.0.1`: ``` diff --git a/versioned_docs/version-5.0/doc/webrtc.md b/versioned_docs/version-5.0/doc/webrtc.md index bdf54c8..45e8bf7 100644 --- a/versioned_docs/version-5.0/doc/webrtc.md +++ b/versioned_docs/version-5.0/doc/webrtc.md @@ -163,10 +163,21 @@ For each vhost, the configuration is `rtc` section, for example: * `rtc.twcc`:Whether support TWCC for congestion feedback. * `rtc.dtls_role`:The role of dtls when peer is actpass: passive or active. -## Config: Candidate +## Config Candidate Please note that `candidate` is essential important, and most failure is caused by wrong `candidate`, so be careful. +The easiest method to modify the `candidate` involves indicating the `eip` in the URL. For instance, if your server +is `192.168.3.10`, utilize this URL: + +* [http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream&eip=192.168.3.10](http://localhost:8080/players/whip.html?eip=192.168.3.10) + +Moreover, the easiest and most direct method to modify the default UDP port `8000`, particularly when it is +behind a load balancer or proxy, involves utilizing the `eip`. For example, if you employ UDP `18000` as the port, +consider using this URL: + +* [http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream&eip=192.168.3.10:18000](http://localhost:8080/players/whip.html?eip=192.168.3.10:18000) + As it shows, `candidate` is server IP to connect to, SRS will response it in SDP answer as `candidate`, like this one: ```bash @@ -323,6 +334,10 @@ curl "http://localhost:1985/rtc/v1/whip/?ice-ufrag=6pk11386&ice-pwd=l91z529147ri > Note: You can replace `http://localhost` with `https://yourdomain.com` to test HTTPS API. +> Note: For SRS Stack, you should specify the secret, so please change the `/rtc/v1/whip?ice-ufrag=` to `/rtc/v1/whip?secret=xxx&ice-ufrag=` as such. + +> Note: You can also use `eip=ip` or `eip=ip:port` to force SRS to use it as the candidate. Please see [CANDIDATE](#config-candidate) for details. + The answer contains the candidate, the UDP server IP, such as `127.0.0.1`: ```