What's the difference between http://*:80 and http://+:80

HttpNetshWebdeploy

Http Problem Overview


In learning about Web Deploy I came across some netsh.exe commands that talk about http://+:80 and http://*:80. What do those mean?

Http Solutions


Solution 1 - Http

As quoted from URLPrefix Strings (Windows):

> When the host element of a UrlPrefix consists of a single plus sign (+), the UrlPrefix matches all possible host names in the context of its scheme, port and relativeURI elements, and falls into the strong wildcard category. > > When an asterisk (*) appears as the host element, then the UrlPrefix falls into the weak wildcard category. This kind of UrlPrefix matches any host name associated with the specified scheme, port and relativeURI that has not already been matched by a strong-wildcard, explicit, or IP-bound weak-wildcard UrlPrefix. This host specification can be used as a default catch-all in some circumstances, or can be used to specify a large section of URL namespace without having to use many UrlPrefixes.

The :80 afterwards shows the port through which you're accessing the URL matched by the wildcard string. 80 is one of the most (if not the most) common port used to access normal webpages.

Solution 2 - Http

In a few basic words, "*" handles requests if no one else did and "+" handles requests even if it was handled by any other handler.

A good example taken from https://stackoverflow.com/a/9459679/6375269

> http://*:8080/: Receive all HTTP requests on port 8080 that are not > already being handled by some other HttpListener. > > http://+:8080/: Receive all HTTP requests on port 8080 even if they're > already handled by another HttpListener.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkenwarnerView Question on Stackoverflow
Solution 1 - HttprownageView Answer on Stackoverflow
Solution 2 - HttpKroksysView Answer on Stackoverflow