Skip to content

Commit

Permalink
HTTP requests now use default proxy with creds
Browse files Browse the repository at this point in the history
  • Loading branch information
byt3bl33d3r committed Aug 16, 2019
1 parent 7955646 commit 160e6bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Naga/Comms.cs
Expand Up @@ -16,7 +16,8 @@ public static byte[] HttpGet(Uri URL, string Endpoint = "")
{
using (var wc = new WebClient())
{
wc.UseDefaultCredentials = true;
wc.Proxy = WebRequest.GetSystemWebProxy();
wc.Proxy.Credentials = CredentialCache.DefaultCredentials;
byte[] data = wc.DownloadData(FullUrl);
#if DEBUG
Console.WriteLine("[*] Downloaded {0} bytes", data.Length);
Expand All @@ -34,6 +35,8 @@ public static byte[] HttpPost(Uri URL, string Endpoint = "", byte[] payload = de
return Retry.Do(() =>
{
var wr = WebRequest.Create(FullUrl);
wr.Proxy = WebRequest.GetSystemWebProxy();
wr.Proxy.Credentials = CredentialCache.DefaultCredentials;
wr.Method = "POST";
if (payload.Length > 0)
{
Expand Down

0 comments on commit 160e6bb

Please sign in to comment.