WebRTC TURN configuration with coturn in Kubernetes – InvalidAccessError: Both username and credential are required #5551
Unanswered
abdulkadiralltuner
asked this question in
Questions
Replies: 1 comment
-
|
使用ice默认是随机的udp端口不能制定8189,要关掉ice,而且指定8189tcp和udp,并且如果用的容器,要在环境变量中就指定公网ip或者域名,这样才能强制使用tcp的8189,我试了一天才成功。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Hello,
We are trying to use MediaMTX WebRTC streaming in a closed network environment (no internet access). Because of this we cannot use public STUN servers and instead deployed a coturn TURN server inside our Kubernetes cluster.
MediaMTX and coturn are both running in Kubernetes.
The TURN server is reachable and works when tested directly with turnutils_uclient.
Example test:
turnutils_uclient -T -u test -w test123 -p 3479 192.168.1.233
Result:
2 connections are completed
So the TURN server itself appears to be functioning correctly.
MediaMTX WebRTC configuration
Environment
MediaMTX running in Kubernetes
coturn TURN server running in Kubernetes (hostNetwork: true)
Closed LAN environment (no STUN access)
Clients are browsers inside the same network
Stream is accessed through HTTP → WHEP
Example URL:
http://192.168.1.249:31141/SIM-1
Error in browser
When attempting to play the stream we receive the following error in the browser:
InvalidAccessError: Failed to construct 'RTCPeerConnection':
Both username and credential are required when the URL scheme is "turn" or "turns".
Additionally, chrome://webrtc-internals shows:
iceServers: []
So it appears the TURN server configuration is not being passed to the browser.
Expected behavior
The TURN server should be included in the ICE configuration sent to the browser, something like:
iceServers: [
{
urls: "turn:192.168.1.233:3479",
username: "test",
credential: "test123"
}
]
Question
Is webrtcICEServers2 the correct configuration field for TURN servers in this version of MediaMTX?
Or should TURN servers be configured using a different format (e.g. webrtcICEServers)?
Any guidance on the correct configuration for a TURN-only environment (no STUN) would be appreciated.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions