public async Task Run(RequestDelegate serverHandler, ResponseDelegate clientHandler) { this.builder.Configure(app => { app.UseSession(); app.Run(async context => await serverHandler(context)); }); this.host = this.builder.Build(); this.host.Start(); string serviceUrl = $"http://localhost:{host.GetPort()}/"; await clientHandler(serviceUrl); }