Proxy Servers
If your server requires HTTP requests to be made through a proxy, you can follow these steps to set up proxies for the server-side SDK.
Setup
To configure a proxy, create a Configuration object with your API credentials:
- C#
var configuration = new BraintreeConfiguration(
Braintree.Environment.PRODUCTION,
"braintree_merchant_id",
"braintree_public_key",
"braintree_private_key"
);
You can then set a proxy URL and port for your Configuration object:
- C#
configuration.WebProxy = new WebProxy("http://your-proxy-domain.com:8080");
To use an authenticated proxy, you can also pass in a custom proxy object with credentials:
- C#
var proxy = new WebProxy("http://your-proxy-domain.com:8080");
proxy.Credentials = new NetworkCredential("username", "password");
configuration.WebProxy = proxy;
Finally, use your Configuration object to initialize your Braintree gateway:
- C#
BraintreeGateway gateway = new BraintreeGateway(configuration);