IPv6 support for WebRTC¶
IPv6 support for WebRTC is added since build 5.2.660. This led to some changes in configuration settings and connection establishing procedure.
Configuration¶
By default, IPv6 support is disabled. To enable this feature, the following should be done:
-
in flashphoner.properties file set the external IPv6 server address and allow IPv6 candidates
-
in wcs-core.properies file allow IPv6 stack
The following settings can be used to set comma separated IPv4 and IPv6 interfaces to bind
hls.address
http.address
https.address
rtmfp.address
rtmp.address
rtsp.address
rtsp_client_address
ws.address
wss.address
Connection establishing procedure¶
Connection establishing to exchange WebRTC media traffic now looks as follows:
-
Server waits for incoming Binding Request queries to IPv4 and IPv6 interfaces.
-
When a query with
USE-CANDIDATE
attribute is received, the candidate is marked as nominated to use, ifBinding Response
would be received
-
For every browser
Binding Request
server sendsBinding Response
-
At the same time, server sends
Binding Request
to browser. Requests will be repeated if necessary with the following period (1500 ms by default)
-
When
Bindind Response
is received from the first candidate, the timeout is started to wait for another candidates as set in the following parameter (1000 ms by default)
-
When timeout is finished, server sends DTLS
Client Hello
to the priority candidate
When establishing connection with Safari browser, IPv4 candidates are preferred unless some problem in STUN-DTLS procedure occur with such candidate. Therefore, in Safari IPv4 will be used if client has both IPv4 and IPv6 interfaces working and traffic between client and server is not blocked. In other browsers (see example pictures above) IPv6 candidates are preferred.
Known issues¶
1. WebRTC publishing/playback does not work in any browser on IPv6 only host¶
Symptoms
Stream publishing or playback fails with Failed by ICE timeout
error
Solution
If a host has only IPv6 address (and localhost), ICE candidates exchange does not work, RTCPeerConnection.onicecandidate
event is nor fired in most browsers. Use RTMP to publish and RTSP, RTMP, HLS to play.