Skip to content
This repository has been archived by the owner on Jul 25, 2019. It is now read-only.

Proxy Awareness #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion UserVoice/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class Client
public string Secret;
private Client requestToken = null;

public Client(string subdomainName, string apiKey, string apiSecret=null, string callback=null, string token=null, string secret=null, string uservoiceDomain=null, string protocol=null) {
public Client(string subdomainName, string apiKey, string apiSecret=null, string callback=null, string token=null, string secret=null, string uservoiceDomain=null, string protocol=null, IWebProxy proxy = null) {
this.protocol = protocol ?? "https";
this.uservoiceDomain = uservoiceDomain ?? "uservoice.com";
this.apiKey = apiKey;
Expand All @@ -44,10 +44,12 @@ public Client(string subdomainName, string apiKey, string apiSecret=null, string
consumer = new RestClient(this.protocol + "://" + this.subdomainName + "." + this.uservoiceDomain);
if (apiSecret != null) {
consumer.Authenticator = OAuth1Authenticator.ForRequestToken(apiKey, apiSecret, callback);
consumer.Proxy = proxy;
}
if (token != null && secret != null) {
accessToken = new RestClient(this.protocol + "://" + this.subdomainName + "." + this.uservoiceDomain);
accessToken.Authenticator = OAuth1Authenticator.ForAccessToken(apiKey, apiSecret, token, secret);
accessToken.Proxy = proxy;
}
}
private RestClient getToken() {
Expand Down