The Wayback Machine - https://web.archive.org/web/20250722045415/https://github.com/aspnet/Announcements/issues/181
Skip to content

Kestrel - Remove support for server URLs which contain only port number #181

@mikeharder

Description

@mikeharder

For discussion and questions related to these changes, please see: aspnet/KestrelHttpServer#867

Summary

We have removed support in Kestrel for server URLs which contain only a port number. This was done to avoid confusion about whether Kestrel would bind to http://locahost:port or http://+:port.

Example

In RC2, the following code causes Kestrel to bind to http://+:12345:

var host = new WebHostBuilder()
    .UseUrls("12345")
    .UseKestrel()

In future releases, the code must be changed to explicitly bind to either localhost or +:

var host = new WebHostBuilder()
    .UseUrls("http://localhost:12345")
    .UseKestrel()
var host = new WebHostBuilder()
    .UseUrls("http://+:12345")
    .UseKestrel()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions