Example #1
0
 /// <summary>Tracks tunnelling to the target.</summary>
 /// <remarks>Tracks tunnelling to the target.</remarks>
 /// <param name="secure">
 /// <code>true</code> if the route is secure,
 /// <code>false</code> otherwise
 /// </param>
 public void TunnelTarget(bool secure)
 {
     Asserts.Check(this.connected, "No tunnel unless connected");
     Asserts.NotNull(this.proxyChain, "No tunnel without proxy");
     this.tunnelled = RouteInfo.TunnelType.Tunnelled;
     this.secure    = secure;
 }
Example #2
0
 /// <since>4.2</since>
 public void Reset()
 {
     this.connected  = false;
     this.proxyChain = null;
     this.tunnelled  = RouteInfo.TunnelType.Plain;
     this.layered    = RouteInfo.LayerType.Plain;
     this.secure     = false;
 }
Example #3
0
 /// <summary>Creates a new route tracker.</summary>
 /// <remarks>
 /// Creates a new route tracker.
 /// The target and origin need to be specified at creation time.
 /// </remarks>
 /// <param name="target">the host to which to route</param>
 /// <param name="local">
 /// the local address to route from, or
 /// <code>null</code> for the default
 /// </param>
 public RouteTracker(HttpHost target, IPAddress local)
 {
     // the attributes above are fixed at construction time
     // now follow attributes that indicate the established route
     Args.NotNull(target, "Target host");
     this.targetHost   = target;
     this.localAddress = local;
     this.tunnelled    = RouteInfo.TunnelType.Plain;
     this.layered      = RouteInfo.LayerType.Plain;
 }
Example #4
0
 private HttpRoute(HttpHost target, IPAddress local, IList <HttpHost> proxies, bool
                   secure, RouteInfo.TunnelType tunnelled, RouteInfo.LayerType layered)
 {
     Args.NotNull(target, "Target host");
     this.targetHost   = target;
     this.localAddress = local;
     if (proxies != null && !proxies.IsEmpty())
     {
         this.proxyChain = new AList <HttpHost>(proxies);
     }
     else
     {
         this.proxyChain = null;
     }
     if (tunnelled == RouteInfo.TunnelType.Tunnelled)
     {
         Args.Check(this.proxyChain != null, "Proxy required if tunnelled");
     }
     this.secure    = secure;
     this.tunnelled = tunnelled != null ? tunnelled : RouteInfo.TunnelType.Plain;
     this.layered   = layered != null ? layered : RouteInfo.LayerType.Plain;
 }
Example #5
0
 /// <summary>Creates a new route with at most one proxy.</summary>
 /// <remarks>Creates a new route with at most one proxy.</remarks>
 /// <param name="target">the host to which to route</param>
 /// <param name="local">
 /// the local address to route from, or
 /// <code>null</code> for the default
 /// </param>
 /// <param name="proxy">
 /// the proxy to use, or
 /// <code>null</code> for a direct route
 /// </param>
 /// <param name="secure">
 /// <code>true</code> if the route is (to be) secure,
 /// <code>false</code> otherwise
 /// </param>
 /// <param name="tunnelled">
 /// <code>true</code> if the route is (to be) tunnelled
 /// via the proxy,
 /// <code>false</code> otherwise
 /// </param>
 /// <param name="layered">
 /// <code>true</code> if the route includes a
 /// layered protocol,
 /// <code>false</code> otherwise
 /// </param>
 public HttpRoute(HttpHost target, IPAddress local, HttpHost proxy, bool secure, RouteInfo.TunnelType
                  tunnelled, RouteInfo.LayerType layered) : this(target, local, proxy != null ? Sharpen.Collections
                                                                 .SingletonList(proxy) : null, secure, tunnelled, layered)
 {
 }
Example #6
0
 /// <summary>Creates a new route with all attributes specified explicitly.</summary>
 /// <remarks>Creates a new route with all attributes specified explicitly.</remarks>
 /// <param name="target">the host to which to route</param>
 /// <param name="local">
 /// the local address to route from, or
 /// <code>null</code> for the default
 /// </param>
 /// <param name="proxies">
 /// the proxy chain to use, or
 /// <code>null</code> for a direct route
 /// </param>
 /// <param name="secure">
 /// <code>true</code> if the route is (to be) secure,
 /// <code>false</code> otherwise
 /// </param>
 /// <param name="tunnelled">the tunnel type of this route</param>
 /// <param name="layered">the layering type of this route</param>
 public HttpRoute(HttpHost target, IPAddress local, HttpHost[] proxies, bool secure
                  , RouteInfo.TunnelType tunnelled, RouteInfo.LayerType layered) : this(target, local
                                                                                        , proxies != null ? Arrays.AsList(proxies) : null, secure, tunnelled, layered)
 {
 }