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

WebRTC: Support configure CANDIDATE by env (#3470)

In dockerfile, we can set the default RTC candidate to env:

```
ENV SRS_RTC_SERVER_CANDIDATE=\$CANDIDATE
CMD ["./objs/srs", "-e"]
```

When starts a docker container, user can setup the candidate by env:

```
docker run --rm -it --env CANDIDATE=1.2.3.4 ossrs/srs:5
```

We should parse the content of SRS_RTC_SERVER_CANDIDATE as env variable name and parse it again.

PICK b34255c3d0

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
This commit is contained in:
Winlin 2023-03-27 19:24:08 +08:00 committed by winlin
parent 6b2c6b3274
commit fdaab863dc
5 changed files with 27 additions and 4 deletions

View file

@ -549,7 +549,8 @@ if [[ $SRS_RTC == YES && $SRS_FFMPEG_OPUS != YES ]]; then
rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/opus-1.3.1 ${SRS_OBJS}/${SRS_PLATFORM}/3rdpatry/opus ${SRS_OBJS}/opus &&
tar xf ${SRS_WORKDIR}/3rdparty/opus-1.3.1.tar.gz -C ${SRS_OBJS}/${SRS_PLATFORM} &&
(
cd ${SRS_OBJS}/${SRS_PLATFORM}/opus-1.3.1 &&
# Opus requires automake 1.15, and fails for automake 1.16+, so we run autoreconf to fix it.
cd ${SRS_OBJS}/${SRS_PLATFORM}/opus-1.3.1 && autoreconf &&
./configure --prefix=${SRS_DEPENDS_LIBS}/${SRS_PLATFORM}/3rdpatry/opus --enable-static $OPUS_OPTIONS
) &&
make -C ${SRS_OBJS}/${SRS_PLATFORM}/opus-1.3.1 ${SRS_JOBS} &&