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

2

66

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

Shortterm answered 4/1, 2011 at 20:35 Comment(0)
A
59

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.

Antibiosis answered 4/1, 2011 at 21:0 Comment(0)
A
21

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://mcmap.net/q/297686/-difference-between-http-8080-and-http-8080

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.

Acerbate answered 31/8, 2018 at 6:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.