Day19 部署 STUN / TURN server

安装 coturn

  1. 使用 apt 安装

    ❯ sudo apt update
    ❯ sudo apt install coturn
    ❯ turnserver -a -o -v -n --no-dtls --no-tls \
    		-u username:password -r testRealm & sleep infinity
    
  2. 自己编译原始码

    ❯ sudo apt update
    ❯ sudo apt install build-essential
    
    ❯ git clone https:// github.com/coturn/coturn.git
    ❯ cd coturn
    # 可能会有缺一些套件 缺什麽就装什麽
    ❯ ./configure --prefix =/usr/local/coturn
    ❯ sudo make -j 4 && sudo make install
    
    

    https://ithelp.ithome.com.tw/upload/images/20210929/20130062VUO0NmaOqy.png

  3. 使用 Docker

    Dockerfile

    FROM ubuntu:20.04
    
    # Setup turn server
    
    RUN apt-get update -y
    RUN apt-get install coturn -y
    
    EXPOSE 3478/tcp
    EXPOSE 3478/udp
    
    CMD turnserver -a -o -v -n --no-dtls --no-tls -u username:password -r testRealm & sleep infinity
    

    启动 docker

    ❯ docker build --tag coturn .
    ❯ docker run -p 3478:3478 -p 3478:3478/udp coturn
    

GCP 开 Port

https://ithelp.ithome.com.tw/upload/images/20210929/201300623uIsNhFykM.png

测试

测试网址: https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/

网页中可以看到一句话

If you test a STUN server, it works if you can gather a candidate with type "srflx". If you test a TURN server, it works if you can gather a candidate with type "relay".

stun 测试

https://ithelp.ithome.com.tw/upload/images/20210929/20130062WhpNxaeWVV.png

turn 测试

https://ithelp.ithome.com.tw/upload/images/20210929/20130062hXSazJ0rKn.png


<<:  [Day-24] 小练习十进制转二进制

>>:  赋权-团队里,没有人是局外人

D12 使用者个人文件页

首页完成後 让使用者可以进入使用者个人文件页 列出属於此使用者的文件 我已经先用测试网页塞了测试资料...

Day 40 (PHP)

1.阵列抓值 (1)打开$person的'programs'(key) 抓 $language(va...

见习村27 - First non-repeating character

27 - First non-repeating character Don't say so mu...

day10: CSS style 规划 - utility CSS(Tailwind)-1

在前面章节我们介绍过 纯 CSS, CSS in JS 那接下来我们要来介绍 utility CSS...

建立第一个RESTful api server(实作篇)-1(Day12)

前面介绍了那麽多内容,那接下来就让我们来实作第一个restful api server吧 在每个後端...