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.

SetupAnchorIcon

To configure a proxy, create a Configuration object with your API credentials:

  1. 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:

  1. 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:

  1. 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:

  1. C#
BraintreeGateway gateway = new BraintreeGateway(configuration);

If you accept cookies, we’ll use them to improve and customize your experience and enable our partners to show you personalized PayPal ads when you visit other sites. Manage cookies and learn more