Skip to content
This repository has been archived by the owner. It is now read-only.

Discussion: Kestrel - Remove support for server URLs which contain only port number #867

Closed
mikeharder opened this issue May 23, 2016 · 11 comments

Comments

@mikeharder
Copy link
Contributor

commented May 23, 2016

This issue is for discussion and questions related to aspnet/Announcements#181

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()
@khellang

This comment has been minimized.

Copy link
Contributor

commented May 23, 2016

@mikeharder Think it might be worth locking aspnet/Announcements#181? 😄

@mikeharder

This comment has been minimized.

Copy link
Contributor Author

commented May 23, 2016

@khellang: Thanks for the reminder.

@nbarbettini

This comment has been minimized.

Copy link

commented May 23, 2016

If I recall correctly, the syntax before was http://*:12345. What's the reasoning for changing it to +?

@Tratcher

This comment has been minimized.

Copy link
Member

commented May 23, 2016

The host doesn't actually matter in kestrel. Only localhost has a defined meaning. Anything else binds to 0.0.0.0.

@mikeharder

This comment has been minimized.

Copy link
Contributor Author

commented May 23, 2016

Other consumers of the URL might treat http://+ and http://* differently. For example, see strong wildcard and weak wildcard in the documentation for http.sys: https://msdn.microsoft.com/en-us/library/aa364698%28v=VS.85%29.aspx

@glennc

This comment has been minimized.

Copy link
Member

commented May 24, 2016

We didn't actually change kestrel to evaluate + and * though right? Just using + in the examples to avoid a potential issue if you switch your app to a http.sys based server?

@mikeharder

This comment has been minimized.

Copy link
Contributor Author

commented May 24, 2016

@glennc: Correct. We can switch to using http://* in examples if it causes less confusion.

@natemcmaster

This comment has been minimized.

Copy link
Contributor

commented May 26, 2016

I'd like to add a vote for http://*

@MedAnd

This comment has been minimized.

Copy link

commented Jun 28, 2016

@mikeharder

In RC2 and from older self-host owin guidance I found on Azure it seems the following makes Kestrel listen to all IP address assigned to a machine:

.UseUrls("http://+:12345")

Is this feature still supported in post RC2 (aka RTM) Kestrel builds? We have an issue where we need Kestrel to listen to all IP addresses assigned to an Azure VM without hard coding these values.

Thanks.

@Tratcher

This comment has been minimized.

Copy link
Member

commented Jun 28, 2016

Yes, that's still supported. The specific wildcard character you use does not really matter yet, kestrel only special cases IP Addresses and localhost. Anything else will cause it to listen on all IPs.

@muratg

This comment has been minimized.

Copy link
Contributor

commented May 12, 2017

We are closing this issue because no further action is planned for this issue. If you still have any issues or questions, please log a new issue with any additional details that you have.

@muratg muratg closed this May 12, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
8 participants
You can’t perform that action at this time.