Skip to content

Commit

Permalink
feat: support setting ICE ufrag and pwd
Browse files Browse the repository at this point in the history
paullouisageneau/libjuice#243 allows setting
the ICE ufrag and pwd fields instead of generating random ones every
time.

paullouisageneau/libdatachannel#1201 exposes
config keys to allow setting the fields in libjuice from libdatachannel.

This PR allows setting the fields in libdatachannel from the PeerConnection
constructor.

It will require the two PRs above being merged an shipped before this
is ready for merging.

Refs: paullouisageneau/libdatachannel#1166
  • Loading branch information
achingbrain committed Jun 6, 2024
1 parent d59c64c commit da4e63c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/peer-connection-wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@ PeerConnectionWrapper::PeerConnectionWrapper(const Napi::CallbackInfo &info) : N
}
}

// Override ICE ufrag/password if set
if (config.Get("iceUfrag").IsString()) {
rtcConfig.iceUfrag = config.Get("iceUfrag").As<Napi::String>().ToString();
}
if (config.Get("icePwd").IsString()) {
rtcConfig.icePwd = config.Get("icePwd").As<Napi::String>().ToString();
}

// Create peer-connection
try
{
Expand Down

0 comments on commit da4e63c

Please sign in to comment.