Mantid
Loading...
Searching...
No Matches
NetworkProxyLinux.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
8#include <Poco/URI.h>
9
10namespace Mantid::Kernel {
11
12//----------------------------------------------------------------------------------------------
15NetworkProxy::NetworkProxy() : m_logger("network_proxy_logger_generic") {}
16
17ProxyInfo NetworkProxy::getHttpProxy(const std::string & /*unused*/) {
18 ProxyInfo proxyInfo; // NoProxy.
19 char *proxy_var = getenv("http_proxy");
20 if (proxy_var == nullptr)
21 proxy_var = getenv("HTTP_PROXY");
22
23 if (proxy_var != nullptr) {
24 Poco::URI uri_p(proxy_var);
25 proxyInfo = ProxyInfo(uri_p.getHost(), uri_p.getPort(), true /*http proxy*/);
26 }
27 return proxyInfo;
28}
29
30} // namespace Mantid::Kernel
ProxyInfo getHttpProxy(const std::string &targetURLString)
Get http proxy information.
ProxyInfo : Container for carrying around network proxy information.
Definition: ProxyInfo.h:17