Skip to content

Commit 23a03e2

Browse files
committed
Allow overriding ICE ufrag and pwd fields
Adds two new optional config keys - `iceUfrag` and `icePwd` which are passed to libjuice. Depends on: paullouisageneau/libjuice#249 Refs: #1166
1 parent 541d646 commit 23a03e2

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

include/rtc/configuration.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ struct RTC_CPP_EXPORT Configuration {
9393
optional<string> certificatePemFile;
9494
optional<string> keyPemFile;
9595
optional<string> keyPemPass;
96+
97+
// Overriding ICE ufrag/pwd
98+
optional<string> iceUfrag;
99+
optional<string> icePwd;
96100
};
97101

98102
#ifdef RTC_ENABLE_WEBSOCKET

src/impl/icetransport.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ IceTransport::IceTransport(const Configuration &config, candidate_callback candi
9090
jconfig.cb_recv = IceTransport::RecvCallback;
9191
jconfig.user_ptr = this;
9292

93+
if (config.iceUfrag) {
94+
jconfig.ice_ufrag = config.iceUfrag->c_str();
95+
}
96+
97+
if (config.icePwd) {
98+
jconfig.ice_pwd = config.icePwd->c_str();
99+
}
100+
93101
if (config.enableIceTcp) {
94102
PLOG_WARNING << "ICE-TCP is not supported with libjuice";
95103
}

0 commit comments

Comments
 (0)