public override async Task Start(TestContext ctx, CancellationToken cancellationToken) { var listener = new ProxyListener(ctx, this); if (Interlocked.CompareExchange(ref currentListener, listener, null) != null) { throw new InternalErrorException(); } await Target.Start(ctx, cancellationToken).ConfigureAwait(false); await listener.Start(); }
private ProxyListener GetListener(ProxyConfig config, bool allowBypass = true) { this.allowBypass = allowBypass; if (listener == null) { listener = new ProxyListener(config); listener.Start(); } if (listener.Version != config.Version) { throw new Exception("Socks Version Mismatch for Port " + config.HttpPort); } return(listener); }