use of com.microsoft.azure.proton.transport.proxy.ProxyHandler in project azure-iot-sdk-java by Azure.
the class AmqpConnectionHandler method addProxyLayer.
private void addProxyLayer(Transport transport, String hostName) {
log.trace("Adding proxy layer to amqp_ws connection");
ProxyImpl proxy = new ProxyImpl();
final ProxyHandler proxyHandler = new ProxyHandlerImpl();
proxy.configure(hostName + ":" + AmqpConnectionHandler.AMQPS_WS_PORT, null, proxyHandler, transport);
((TransportInternal) transport).addTransportLayer(proxy);
}
use of com.microsoft.azure.proton.transport.proxy.ProxyHandler in project azure-iot-sdk-java by Azure.
the class AmqpsIotHubConnection method addProxyLayer.
private void addProxyLayer(Transport transport, String hostName) {
log.debug("Adding proxy layer to amqp transport");
ProxyImpl proxy;
if (proxySettings.getUsername() != null && proxySettings.getPassword() != null) {
log.trace("Adding proxy username and password to amqp proxy configuration");
ProxyConfiguration proxyConfiguration = new ProxyConfiguration(ProxyAuthenticationType.BASIC, proxySettings.getProxy(), proxySettings.getUsername(), new String(proxySettings.getPassword()));
proxy = new ProxyImpl(proxyConfiguration);
} else {
log.trace("No proxy username and password will be used amqp proxy configuration");
proxy = new ProxyImpl();
}
final ProxyHandler proxyHandler = new ProxyHandlerImpl();
proxy.configure(hostName, null, proxyHandler, transport);
((TransportInternal) transport).addTransportLayer(proxy);
}
Aggregations