public DemoConfigurationSource(int responseCount, string reverseProxyUri = null) { ResponseCount = responseCount; ReverseProxyOptions = new ReverseProxyOptions(); _reverseProxyUri = reverseProxyUri ?? "http://localhost/demoreverseproxy"; }
public ProxyApiTo(string to, ReverseProxyOptions options, Func <ICommunicationContext, string> operation = null) { this.to = to; this.options = options; this.operation = operation ?? (ctx => ctx.Request.Uri.ToString()); }
public PingController(IOptions <ReverseProxyOptions> proxyOptions) { if (proxyOptions?.Value == null) { throw new ArgumentNullException(nameof(proxyOptions)); } _reverseProxyOptions = proxyOptions.Value; }
public ProxyApiFrom( string from, string to, ReverseProxyOptions options) { this.from = from; this.to = to; this.options = options; }
TestServer CreateToServer() { var options = new ReverseProxyOptions(); _toOptions?.Invoke(options); return(_toServer = new TestServer( new WebHostBuilder() .Configure(app => { app.UseOpenRasta( new ProxyApiTo( _to, options, _handler)); }))); }
TestServer CreateFromServer() { var options = new ReverseProxyOptions { HttpMessageHandler = () => _toServer.CreateHandler() }; _fromOptions?.Invoke(options); return(new TestServer( new WebHostBuilder() .Configure(app => { app.UseOpenRasta( new ProxyApiFrom(_from, _to, options)); }))); }
public void ShouldByDefaultContainFilter(string filterTypeName) { var proxy = new ReverseProxyOptions(); Assert.Contains(proxy.Filters, x => x.GetType().Name == filterTypeName); }