Connecting through an HTTP proxy
Clients can connect to the Diffusion™ server through an HTTP proxy by using the HTTP CONNECT verb to create the connection and tunneling any of the supported transports through that connection.
Android™, Java™, and .NET clients can connect to the Diffusion server through an HTTP proxy by specifying additional information on connection.
With no authentication at the proxy
When creating your session, add an HTTP proxy to the session by passing in the host and port number of the proxy.
Diffusion.sessions().httpProxy(host, port)
var session = Diffusion.Sessions .HttpProxy( host, port ) .Open( diffusionUrl );
With basic authentication at the proxy
If the proxy requires basic authentication, the client can use the implementation in the Unified API to authenticate.
When creating your session, add an HTTP proxy to the session by passing in the host and port number of the proxy and a proxy authentication object that provides the challenge handler for basic authentication.
HTTPProxyAuthentication auth = Diffusion.proxyAuthentication().basic(username, password); Diffusion.sessions().httpProxy(host, port, auth);
var clientAuth = Diffusion.ProxyAuthentication.Basic( username, password ); var session = Diffusion.Sessions .HttpProxy( host, port, clientAuth ) .Open( diffusionUrl );
With another form of authentication at the proxy
If the proxy requires another form of authentication, the client can implement a challenge handler that the client uses to authenticate.
Implement the HTTPProxyAuthentication interface to provide a challenge handler that can handle the type of authentication your proxy uses. When creating your session, add an HTTP proxy to the session by passing in the host and port number of the proxy and a proxy authentication object that provides your challenge handler.