diff --git a/src/Discord.Net.Rest/Net/DefaultRestClient.cs b/src/Discord.Net.Rest/Net/DefaultRestClient.cs index 7142ad0e..7e10a27e 100644 --- a/src/Discord.Net.Rest/Net/DefaultRestClient.cs +++ b/src/Discord.Net.Rest/Net/DefaultRestClient.cs @@ -24,7 +24,7 @@ namespace Discord.Net.Rest private CancellationToken _cancelToken; private bool _isDisposed; - public DefaultRestClient(string baseUrl, bool useProxy = false) + public DefaultRestClient(string baseUrl, bool useProxy = false, IWebProxy webProxy = null) { _baseUrl = baseUrl; @@ -34,6 +34,7 @@ namespace Discord.Net.Rest AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate, UseCookies = false, UseProxy = useProxy, + Proxy = webProxy }); #pragma warning restore IDISP014 SetHeader("accept-encoding", "gzip, deflate"); diff --git a/src/Discord.Net.Rest/Net/DefaultRestClientProvider.cs b/src/Discord.Net.Rest/Net/DefaultRestClientProvider.cs index 67b47096..66e3f83c 100644 --- a/src/Discord.Net.Rest/Net/DefaultRestClientProvider.cs +++ b/src/Discord.Net.Rest/Net/DefaultRestClientProvider.cs @@ -1,4 +1,5 @@ using System; +using System.Net; namespace Discord.Net.Rest { @@ -7,13 +8,13 @@ namespace Discord.Net.Rest public static readonly RestClientProvider Instance = Create(); /// The default RestClientProvider is not supported on this platform. - public static RestClientProvider Create(bool useProxy = false) + public static RestClientProvider Create(bool useProxy = false, IWebProxy webProxy = null) { return url => { try { - return new DefaultRestClient(url, useProxy); + return new DefaultRestClient(url, useProxy, webProxy); } catch (PlatformNotSupportedException ex) {