Exemple #1
0
        public HttpTunnelClient CreateTunnelClient(ushort listenPort, SocksProxyType runType, IPEndPoint directTo, Guid?remoteID)
        {
            var config        = AgentHubConfig.AppConfig;
            var serverBalance = this.GetServerBalance(config);
            HttpTunnelClient client;

            if (directTo == null)
            {
                client = new HttpTunnelClient(listenPort, serverBalance, config.Credential, runType);
            }
            else
            {
                client = new HttpTunnelClient(listenPort, serverBalance, config.Credential, directTo);
            }
            client.ReverseRemoteID = remoteID;
            client.ServerRejected += client_ServerRejected;
            if (this.FirstClient == null)
            {
                this.FirstClient = client;
            }
            return(client);
        }
Exemple #2
0
 public HttpTunnelClient(ushort listenPort, Uri[] serverBalance, NetworkCredential credential, SocksProxyType runType)
     : this(listenPort, serverBalance, credential, null, runType)
 {
 }