datalust / nlog-targets-seq

An NLog target that writes events to Seq. Built for NLog 4.5+.
https://getseq.net
Apache License 2.0
21 stars 11 forks source link

Enable auto detection of proxy configuration #21

Open snakefoot opened 6 years ago

snakefoot commented 6 years ago
            IWebProxy proxy = WebRequest.GetSystemWebProxy();
            proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
            request.Proxy = proxy;
            request.PreAuthenticate = true;

Cache the default proxy to avoid auto lookup for every WebRequest.

Maybe a tristate (Explicit Proxy, Auto Proxy, Without Proxy - null):

https://stackoverflow.com/questions/2519655/httpwebrequest-is-extremely-slow

Can also be configured globally for the entire application:

<system.net>
    <defaultProxy enabled="true" useDefaultCredentials="true">
         <proxy usesystemdefault="True" />
    </defaultProxy>
</system.net>

https://msdn.microsoft.com/en-us/library/dkwyc043.aspx

nblumhardt commented 6 years ago

Thanks @snakefoot , makes sense! 👍