7 private static readonly
char[]
s_proxyDelimiters =
new char[5] {
';',
' ',
'\n',
'\r',
'\t' };
48 int charactersConsumed;
51 int num =
array.Length;
54 proxyString = proxyString.Slice(charactersConsumed);
61 if (
string.IsNullOrEmpty(proxyConfig))
65 return new MultiProxy(failedProxyCache, proxyConfig, secure);
68 public bool ReadNext([NotNullWhen(
true)] out
Uri uri, out
bool isFinalProxy)
80 long num =
long.MaxValue;
84 if (proxyRenewTicks == 0
L)
89 if (proxyRenewTicks < num)
92 num = proxyRenewTicks;
116 isFinalProxy =
false;
125 int charactersConsumed;
132 isFinalProxy =
false;
138 int num = (secure ? 1 : 2);
146 if (i == proxyString.
Length)
150 proxyString = proxyString.
Slice(i);
152 if (proxyString.StartsWith(
"http="))
155 proxyString = proxyString.
Slice(
"http=".Length);
157 else if (proxyString.StartsWith(
"https="))
160 proxyString = proxyString.
Slice(
"https=".Length);
162 if (proxyString.StartsWith(
"http://"))
165 proxyString = proxyString.
Slice(
"http://".Length);
167 else if (proxyString.StartsWith(
"https://"))
170 proxyString = proxyString.
Slice(
"https://".Length);
179 charactersConsumed =
length - proxyString.Length + i;
182 proxyString = proxyString.
Slice(i);
185 charactersConsumed =
length;
int IList. IndexOf(object value)
void SetProxyFailed(Uri uri)
long GetProxyRenewTicks(Uri uri)
bool TryRenewProxy(Uri uri, long renewTicks)
static bool TryCreate([NotNullWhen(true)] string? uriString, UriKind uriKind, [NotNullWhen(true)] out Uri? result)
static MultiProxy CreateLazy(FailedProxyCache failedProxyCache, string proxyConfig, bool secure)
MultiProxy(FailedProxyCache failedProxyCache, string proxyConfig, bool secure)
readonly FailedProxyCache _failedProxyCache
readonly string _proxyConfig
bool ReadNext([NotNullWhen(true)] out Uri uri, out bool isFinalProxy)
static readonly char[] s_proxyDelimiters
static MultiProxy Parse(FailedProxyCache failedProxyCache, string proxyConfig, bool secure)
static bool TryParseProxyConfigPart(ReadOnlySpan< char > proxyString, bool secure, [NotNullWhen(true)] out Uri uri, out int charactersConsumed)
bool ReadNextHelper([NotNullWhen(true)] out Uri uri, out bool isFinalProxy)
MultiProxy(FailedProxyCache failedProxyCache, Uri[] uris)
ReadOnlySpan< T > Slice(int start)