Webrtc media over tcp?

前端 未结 1 478
囚心锁ツ
囚心锁ツ 2021-01-01 01:59

I am new to WebRTC.

I was learned about the turn server.

The below thing is used to configure the turn server works on TCP for a webrtc application.

相关标签:
1条回答
  • 2021-01-01 02:08

    Forcing WebRTC media over TCP is not recommended, its just a fallback option for strict firewalls.

    If you specify ?transport=tcp in TURN urls, then WebRTC client will connect to TURN Server over TCP.
    Clients will send STUN requests over TCP to allocate relay candidates (As far as i know, currently chrome/firefox only request UDP relay candidates).

    To force strict TCP via TURN server:

    • Use only TURN url with ?transport=tcp
    • Specify iceTransportPolicy:"relay", so that all media will flow via TURN

    After exchanging the relay candidates(udp) between peerConnections, the media path will be as below

    P1 <--TCP--> P1TURN <--UDP--> P2TURN <--TCP--> P2

    If both P1TURN & P2TURN are always same, then you can choose TURN relay path as LAN/lo interface i.e. you will get UDP relay candidates with LAN/lo IP.

    If you want to avoid UDP & two times TURN in the media path, you need to use some SFU/SVC like Jitsi(supports pseudo-SSL candidates)/Janus.
    Then media path will be as below

    P1 <--TCP--> SFU/MCU <--TCP--> P2

    0 讨论(0)
提交回复
热议问题