MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / SetProxyAuthentication

Method SetProxyAuthentication

cpp/iedriver/ProxyManager.cpp:369–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369void ProxyManager::SetProxyAuthentication(const std::wstring& user_name,
370 const std::wstring& password) {
371 LOG(TRACE) << "ProxyManager::SetProxyAuthentication";
372 BOOL success = ::InternetSetOption(NULL,
373 INTERNET_OPTION_PROXY_USERNAME,
374 const_cast<wchar_t*>(user_name.c_str()),
375 static_cast<int>(user_name.size()) + 1);
376 if (!success) {
377 LOGERR(WARN) << "InternetSetOption failed setting INTERNET_OPTION_PROXY_USERNAME";
378 }
379
380 success = ::InternetSetOption(NULL,
381 INTERNET_OPTION_PROXY_PASSWORD,
382 const_cast<wchar_t*>(password.c_str()),
383 static_cast<int>(password.size()) + 1);
384 if (!success) {
385 LOGERR(WARN) << "InternetSetOption failed setting INTERNET_OPTION_PROXY_PASSWORD";
386 }
387}
388
389void ProxyManager::GetCurrentProxySettings() {
390 LOG(TRACE) << "ProxyManager::GetCurrentProxySettings";

Callers 3

RestoreProxySettingsMethod · 0.95

Calls 2

LOGClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected