Proxy server Address and Port Number

Proxy Configuration
How to set up a proxy server on QNAP Turbo NAS? - QNAP

A proxy server is a server that acts as an intermediary for requests from clients seeking resources from other servers. With eSignLive, you can make API calls via a proxy server.

The Code

To make API calls to eSignLive through a proxy server, you will need to build a ProxyConfiguration object. You will need to pass the proxy server’s address and port number to the WithHttpHost and WithHttpPort methods respectively.

ProxyConfiguration httpProxyConfiguration = ProxyConfigurationBuilder.newProxyConfiguration .WithHttpHost("serverAddress") //e.g. localhost .WithHttpPort(portNumber) //e.g. 8001 .Build;

If you’ve setup your proxy server with additional authentication, such as a username and password, you will need to add it to your ProxyConfiguration object.

ProxyConfiguration httpProxyConfiguration = ProxyConfigurationBuilder.newProxyConfiguration .WithHttpHost("serverAddress") .WithHttpPort(portNumber) .WithCredentials("httpUser", "httpPwd") .Build;

The final step is to create your EslClient object. It is important to note that trusting all certificates should not be enabled for security reasons.

Boolean allowAllSSLCertificates = false; EslClient client = new EslClient(API_KEY, API_URL, allowAllSSLCertificates, httpProxyConfiguration);

To make API calls to eSignLive through a proxy server, the first step is to build a WebProxy object. The UseDefaultCredentials property should be set to true when requests made by your WebProxy object should, if requested by the server, be authenticated using the credentials of the currently logged on user. Otherwise, set this property to false.

string proxyUri = string.Format("{0}:{1}", "serverAddress", portNumber); //e.g. 13.1. WebProxy proxy = new WebProxy(proxyUri, false) { UseDefaultCredentials = false };

Next, you will need to create your HttpClient that you will used to send requests to eSignLive. In this example, you wil need to create one with a specific handler. The Proxy property sets the proxy information used by the handler and the PreAuthenticate property indicates the handler will send an Authorization header with the request.

HttpClient client = null; HttpClientHandler httpClientHandler = new HttpClientHandler { Proxy = proxy, PreAuthenticate = true, UseDefaultCredentials = false, };

If you’ve setup your proxy server with additional authentication, such as a username and password, you will need to add it to your handler.

string httpUserName = "httpUser", httpPassword = "httpPwd"; httpClientHandler.Credentials = new NetworkCredential(httpUserName, httpPassword);

Source: developer.esignlive.com


Related posts:

  1. Proxy server Problems
  2. Proxy Address Port
  3. Us proxy IP Address and Port Number
  4. Proxy Servers For Windows