Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ HttpWindowsProxy()

System.Net.Http.HttpWindowsProxy.HttpWindowsProxy ( WinInetProxyHelper proxyHelper,
global::Interop::WinHttp::SafeWinHttpHandle sessionHandle )
inlineprivate

Definition at line 73 of file HttpWindowsProxy.cs.

74 {
77 if (!proxyHelper.ManualSettingsUsed)
78 {
79 return;
80 }
81 if (System.Net.NetEventSource.Log.IsEnabled())
82 {
83 System.Net.NetEventSource.Info(proxyHelper, $"ManualSettingsUsed, {proxyHelper.Proxy}", ".ctor");
84 }
87 if (!string.IsNullOrWhiteSpace(proxyHelper.ProxyBypass))
88 {
89 int i = 0;
90 int num = 0;
91 _bypass = new List<string>(proxyHelper.ProxyBypass.Length / 5);
92 while (i < proxyHelper.ProxyBypass.Length)
93 {
94 for (; i < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[i] == ' '; i++)
95 {
96 }
97 if (string.Compare(proxyHelper.ProxyBypass, i, "http://", 0, 7, StringComparison.OrdinalIgnoreCase) == 0)
98 {
99 i += 7;
100 }
101 else if (string.Compare(proxyHelper.ProxyBypass, i, "https://", 0, 8, StringComparison.OrdinalIgnoreCase) == 0)
102 {
103 i += 8;
104 }
105 if (i < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[i] == '[')
106 {
107 i++;
108 }
109 num = i;
110 for (; i < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[i] != ' ' && proxyHelper.ProxyBypass[i] != ';' && proxyHelper.ProxyBypass[i] != ']'; i++)
111 {
112 }
113 string text;
114 if (i == num)
115 {
116 text = null;
117 }
118 else if (string.Compare(proxyHelper.ProxyBypass, num, "<local>", 0, 7, StringComparison.OrdinalIgnoreCase) == 0)
119 {
120 _bypassLocal = true;
121 text = null;
122 }
123 else
124 {
125 text = proxyHelper.ProxyBypass.Substring(num, i - num);
126 }
127 if (i < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[i] != ';')
128 {
129 for (; i < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[i] != ';'; i++)
130 {
131 }
132 }
133 if (i < proxyHelper.ProxyBypass.Length && proxyHelper.ProxyBypass[i] == ';')
134 {
135 i++;
136 }
137 if (text != null)
138 {
140 }
141 }
142 if (_bypass.Count == 0)
143 {
144 _bypass = null;
145 }
146 }
147 if (!_bypassLocal)
148 {
149 return;
150 }
154 {
156 foreach (UnicastIPAddressInformation unicastAddress in iPProperties.UnicastAddresses)
157 {
158 _localIp.Add(unicastAddress.Address);
159 }
160 }
161 }
void Add(TKey key, TValue value)
readonly WinInetProxyHelper _proxyHelper
readonly List< string > _bypass
readonly List< IPAddress > _localIp
global::Interop.WinHttp.SafeWinHttpHandle _sessionHandle
readonly FailedProxyCache _failedProxies
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static NetworkInterface[] GetAllNetworkInterfaces()
static MultiProxy Parse(FailedProxyCache failedProxyCache, string proxyConfig, bool secure)
Definition MultiProxy.cs:43

References System.Net.Http.HttpWindowsProxy._bypass, System.Net.Http.HttpWindowsProxy._bypassLocal, System.Net.Http.HttpWindowsProxy._failedProxies, System.Net.Http.HttpWindowsProxy._insecureProxy, System.Net.Http.HttpWindowsProxy._localIp, System.Net.Http.HttpWindowsProxy._proxyHelper, System.Net.Http.HttpWindowsProxy._secureProxy, System.Net.Http.HttpWindowsProxy._sessionHandle, System.Collections.Generic.List< T >.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Collections.Generic.List< T >.Count, System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces(), System.Net.NetEventSource.Info(), System.Net.NetEventSource.Log, System.Net.Http.MultiProxy.Parse(), and System.text.

Referenced by System.Net.Http.HttpWindowsProxy.TryCreate().