dotnet/aspnetcore

Kestrel outputs to console an http url for non-http connection handlers

Open

#8,565 建立於 2019年3月15日

在 GitHub 查看
 (8 留言) (2 反應) (1 負責人)C# (10,653 fork)batch import
affected-very-fewarea-networkingenhancementfeature-kestrelhelp wantedseverity-nice-to-have🥌 Bedrock

倉庫指標

Star
 (37,933 star)
PR 合併指標
 (平均合併 16天 9小時) (30 天內合併 258 個 PR)

描述

Describe the bug

When running the WebHost for an application, Kestrel outputs a list of Uri's that it's listening on. When using a custom ConnectionHandler with Kestrel which isn't http, it outputs the uri with an http scheme. You will see a line such as the following:

Now listening on: http://0.0.0.0:8808

To Reproduce

  1. Using Microsoft.AspNetCore.App version 2.2.0
  2. Add a custom ConnectionHandler for Kestrel to use with a unique listening endpoint
  3. Build IWebHost and call Run()
  4. See the previously mentioned console output showing the listening endpoint but with the http scheme

Expected behavior

The ideal thing would be to be able to specify the scheme as part of either the config or a virtual property on ConnectionHandler but that's new api and a feature request. Without new api, output the listening endpoint instead of a Uri. e.g.:

Now listening on: 0.0.0.0:8808

貢獻者指南