Closed ChrisTrenkamp closed 10 months ago
I can't seem to be able to reproduce using the webrtc_signaling demo, tested with both Chromium and Firefox
Indeed, I took the signaling demo, created a HTML5 export of it, and tweaked the NodeJS server to serve the HTML5 export with a static file endpoint, and everything seems to work fine.
I guess I'm doing something wrong in my demo, but it's not immediately obvious what it is.
I just realized that the WebRTCPeerConnection.ice_candidate_created
signal is not triggering, and it's because I forgot to call mp_connections.get_peer(MultiplayerPeer.TARGET_PEER_SERVER).get("connection").set_local_description(type, sdp)
in the client. After adding that line, it works in the browser.
Out of curiosity, why do the native clients work fine without setting the local description?
Out of curiosity, why do the native clients work fine without setting the local description?
IIRC that is a quirk in the library we use, i.e. there is (was?) no way to create an offer without calling set_local_description.
We should investigate if that changed in recent versions, or if we can ask upstream to allow that.
Godot version
4.1.3.stable.official
Plugin version
v1.0.3
System information
Windows 11
Issue description
This was already posted here.Deleted because it wasn't a bug, it was PEBKAC.The ICE exchange seems to work fine with native-to-native clients. It also works when the browser calls the create_offer method and exchanges with a native client.
However, the ICE exchange does not work when the native client calls the
create_offer
method and exchanges it with a browser client. The same happens with browser-to-browser ICE exchanges as well.I know nothing about how the ICE exchange works, so I'm just relying on what the server logs are printing.
Native-to-native ICE exchange:
Browser-to-native ICE exchange (browser calls
create_offer
):Native-to-browser ICE exchange (native calls
create_offer
):In the native-to-browser scenario, after the client (browser) sets up its session, it does not send these packets:
Is this something that the webrtc plugin does, or is this something the built-in browser WebRTC capabilities handle? Is this intended functionality in the browser?
Steps to reproduce
webrtc
folder into the root of the project.go build ; ./webrtc-test-server
in theserver
folder.server/static
directory.http://localhost:8080
(the websocket will fail to upgrade if you use127.0.0.1
),Host
. In the native client, enter the same server name and clickConnect
. It should succeed and the two clients can talk to each other.Minimal reproduction project
webrtc-godot.zip