Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions PushSharp.Google/GcmConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Net;

namespace PushSharp.Google
{
Expand Down Expand Up @@ -38,6 +39,8 @@ public void OverrideUrl (string url)
{
GcmUrl = url;
}

public WebProxy Proxy { get; set; }
}
}

12 changes: 11 additions & 1 deletion PushSharp.Google/GcmServiceConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,17 @@ public class GcmServiceConnection : IServiceConnection<GcmNotification>
public GcmServiceConnection (GcmConfiguration configuration)
{
Configuration = configuration;
http = new HttpClient ();
if (null != configuration.Proxy)
{
var httpHandler = new HttpClientHandler
{
Proxy = configuration.Proxy
};
http = new HttpClient(httpHandler, true);
} else
{
http = new HttpClient();
}

http.DefaultRequestHeaders.UserAgent.Clear ();
http.DefaultRequestHeaders.UserAgent.Add (new ProductInfoHeaderValue ("PushSharp", "3.0"));
Expand Down