diff --git a/Octokit/Http/Connection.cs b/Octokit/Http/Connection.cs
index a330736c..d8366577 100644
--- a/Octokit/Http/Connection.cs
+++ b/Octokit/Http/Connection.cs
@@ -36,6 +36,21 @@ namespace Octokit
{
}
+ ///
+ /// Creates a new connection instance used to make requests of the GitHub API.
+ ///
+ ///
+ /// The name (and optionally version) of the product using this library. This is sent to the server as part of
+ /// the user agent for analytics purposes.
+ ///
+ ///
+ /// The client to use for executing requests
+ ///
+ public Connection(ProductHeaderValue productInformation, IHttpClient httpClient)
+ : this(productInformation, _defaultGitHubApiUrl, _anonymousCredentials, httpClient, new SimpleJsonSerializer())
+ {
+ }
+
///
/// Creates a new connection instance used to make requests of the GitHub API.
///
diff --git a/Octokit/Http/HttpClientAdapter.cs b/Octokit/Http/HttpClientAdapter.cs
index 5540c676..1656b023 100644
--- a/Octokit/Http/HttpClientAdapter.cs
+++ b/Octokit/Http/HttpClientAdapter.cs
@@ -18,6 +18,15 @@ namespace Octokit.Internal
///
public class HttpClientAdapter : IHttpClient
{
+ readonly IWebProxy webProxy;
+
+ public HttpClientAdapter() { }
+
+ public HttpClientAdapter(IWebProxy webProxy)
+ {
+ this.webProxy = webProxy;
+ }
+
public async Task> Send(IRequest request)
{
Ensure.ArgumentNotNull(request, "request");
@@ -30,6 +39,12 @@ namespace Octokit.Internal
{
httpOptions.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
}
+ if (httpOptions.SupportsProxy && webProxy != null)
+ {
+ httpOptions.UseProxy = true;
+ httpOptions.Proxy = webProxy;
+ }
+
var http = new HttpClient(httpOptions)
{