Skip to content

Commit

Permalink
Allow overriding ICE ufrag and pwd fields
Browse files Browse the repository at this point in the history
Adds two new optional config keys - `iceUfrag` and `icePwd` which
are passed to libjuice.

Depends on: paullouisageneau/libjuice#249

Refs: paullouisageneau#1166
  • Loading branch information
achingbrain committed Jun 5, 2024
1 parent 541d646 commit 23a03e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/rtc/configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ struct RTC_CPP_EXPORT Configuration {
optional<string> certificatePemFile;
optional<string> keyPemFile;
optional<string> keyPemPass;

// Overriding ICE ufrag/pwd
optional<string> iceUfrag;
optional<string> icePwd;
};

#ifdef RTC_ENABLE_WEBSOCKET
Expand Down
8 changes: 8 additions & 0 deletions src/impl/icetransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ IceTransport::IceTransport(const Configuration &config, candidate_callback candi
jconfig.cb_recv = IceTransport::RecvCallback;
jconfig.user_ptr = this;

if (config.iceUfrag) {
jconfig.ice_ufrag = config.iceUfrag->c_str();
}

if (config.icePwd) {
jconfig.ice_pwd = config.icePwd->c_str();
}

if (config.enableIceTcp) {
PLOG_WARNING << "ICE-TCP is not supported with libjuice";
}
Expand Down

0 comments on commit 23a03e2

Please sign in to comment.