-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remote video blank inside of docker container / elastic beanstalk #2
Comments
same result running the examples on elastic beanstalk. i'm guessing there are a range of ports that need to be exposed for webRTC to work... how do I find out what they are? Thanks!! :) |
related? node-webrtc/node-webrtc#416 |
@imgntn I found that for correct remote execution it is necessary to set ICE server in the webrtcconnection.js:
|
Any update on this? I'm trying to run the video-composing example in a Docker container but only HTTP calls are let through, do we need to have a special port configuration for WEBRTC to work here? |
@xtapac What I don't get here is that the example doesn't provide a way for the peers (here, client and server) to exchange ICE candidates. Did you have to implement it yourself as an endpoint or something? |
@theochampion the way the signaling between client and server works assumes that the server discovers host candidates that the client can reach. Take a look at Regarding Docker, it could be that the host candidates advertised by the server are not reachable by the client (maybe they reference some IP only known within the Docker container). This could be verified by looking at the SDP generated by the server. If this is the case, the ICE server fix described above is a workaround. It might also be fine to just rewrite the IP addresses in the host candidates to the Docker container’s IP(s). |
@markandrus Thanks for the reply. So If I understand well, the server generate a list of candidates for the client to try and just "wait" for the data to arrive from the WebRTCConnection ? Here is the list of candidates sent from my server in the SDP offer
Here
Should allow the client to connect. But if I inspect the webrtcconnection client side using Any ideas? Also, i've noticed this function function disableTrickleIce(sdp) {
return sdp.replace(/\r\na=ice-options:trickle/g, '');
} that modify the SDP, what exactly does that do and should I be using it? Cheers! Edit : I found this post that seems to talk about the issue, but I'm no sure I understand https://groups.google.com/forum/#!topic/discuss-webrtc/MhjXHbaexLw |
Yes
I guess you get this
The logs are showing "icecandidate" events generated in the browser, i.e., local candidates gathered by the browser. No STUN servers are configured, therefore no |
Here is some information for anyone else trying to use Docker: the type of networking used is important. Notice that, if I use the default
However, if I specify the host network, node-webrtc inside the container is going to discover the host's IP (in this case, my laptop—192.168.65.3—however, this could be an EC2 instance, or some other hosted service):
Dockerfile, for reference: # docker/Dockerfile
FROM node:14-alpine AS base
RUN apk update && apk add --no-cache alsa-lib
RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2
RUN DEBUG=true npm install wrtc
ENTRYPOINT ["node", "-e", "var pc = new (require('wrtc').RTCPeerConnection); pc.addTransceiver('audio'); pc.createOffer().then(offer => pc.setLocalDescription(offer)); pc.onicecandidate = event => { if (event.candidate) { console.log(event.candidate.candidate) } else { process.exit() } }"] |
Just ran into this issue too, and I think imgntn's explanation is why the webrtc UDP connection is failing in Docker |
Great info, thanks markandrus! This may explain why WebRTC in Docker Windows hasn't been working for a while |
if i try to expose port 3000 and run the examples inside of a docker container (on my localhost for now), the remote video of all examples is always blank. any advice?
The text was updated successfully, but these errors were encountered: