Proxy server with Java

Proxy Servers | Java
Proxy server with java and flash memory | zajalehonixeq.cba.pl

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.

First, initialize your Braintree gateway with your API credentials:

Java

BraintreeGateway gateway = new BraintreeGateway( Environment.PRODUCTION, "braintree_merchant_id", "braintree_public_key", "braintree_private_key" );

You can then set a proxy URL and port for your Braintree configuration:

String proxyAddress = "your-proxy-domain.com"; int portNumber = 8080; gateway.getConfiguration.setProxy(proxyAddress, portNumber);

You can also create a custom proxy object to pass into setProxy:

SocketAddress address = new InetSocketAddress(" ", 8080); Proxy proxy = new Proxy(Proxy.Type.HTTP, address); gateway.getConfiguration.setProxy(proxy);

Authenticated proxies and override getPasswordAuthentication:

class CustomAuthenticator extends Authenticator { public PasswordAuthentication getPasswordAuthentication { return new PasswordAuthentication ("user", "password".toCharArray); } }

Source: developers.braintreepayments.com


Related posts:

  1. Proxy server not found
  2. Proxy server with JavaScript
  3. Proxy server with Port
  4. SIP proxy server Windows
  5. Proxy server on Windows 7