Transmitter5SetHttpProxyWithCredentials Method
Set the address and port number of the secured HTTP proxy to be used to reach the Internet
Namespace: SwissDecTXAssembly: SwissDecTX.Transmitter5 (in SwissDecTX.Transmitter5.dll) Version: 5.0.0.0 (5.0.0.0)
public void SetHttpProxyWithCredentials(
string host,
int port,
string proxyUserName,
string proxyPassword
)
Public Sub SetHttpProxyWithCredentials (
host As String,
port As Integer,
proxyUserName As String,
proxyPassword As String
)
public:
virtual void SetHttpProxyWithCredentials(
String^ host,
int port,
String^ proxyUserName,
String^ proxyPassword
) sealed
function SetHttpProxyWithCredentials(host, port, proxyUserName, proxyPassword);
Parameters
- host String
- IP address or name of the HTTP proxy server
- port Int32
- Port number, e.g. 8080
- proxyUserName String
- The user name needed to connect to the HTTP Proxy
- proxyPassword String
- The password needed to connect to the HTTP Proxy
Calling this method is normally not needed. SwissDecTX supports automatic detection and execution of proxy configuration scripts. This feature is also known as Web Proxy Auto-Discovery (WPAD). When using automatic proxy configuration, a configuration script, typically named Wpad.dat, must be located, downloaded, compiled, and run. If these operations are successful, the script returns the proxies that can be used for a request. If you pass the empty string to both parameters, the proxy credentials will not be set and the transmitter will not attempt to pass the default user credentials to the proxy.
using SwissDecTX;
// ...
try {
var tx = new Transmitter5();
tx.SetHttpProxyWithCredentials("webproxy", 8080, "proxyUserName", "proxyPassword"); // // SwissDecTX handles "HTTP 407 Proxy Authentication" and authenticates using these credentials
// TODO: Set the certificates and / or URL if needed
// TODO: Use the transmitter...
} catch (Exception ex) {
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}