Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 341
kenwarner Avatar asked Jan 04 '11 20:01

kenwarner


People also ask

Which HTTP port should I use?

Port 80 is the standard for HTTP.

Is HTTP only port 80?

Port 80 is the port number assigned to commonly used internet communication protocol, Hypertext Transfer Protocol (HTTP). It is the default network port used to send and receive unencrypted web pages.

Is 8080 and 80 the same?

Port 80 is the default port. It's what gets used when no port is specified. 8080 is Tomcat's default port so as not to interfere with any other web server that may be running. If you are going to run Tomcat as your web server, the port can be changed to 80 so that visitors do not need to specify it.

Is port 8080 HTTP or HTTPS?

You should not use port 8080 for https traffic. That port is conventionally used for non-secured data, akin to the use of port 80 for default external http. Port 8443 is the standard for Tomcat secured (SSL/TLS) data, corresponding to the common HTTPS port 443.


2 Answers

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.

like image 193
rownage Avatar answered Oct 24 '22 04:10

rownage


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.

like image 38
Kroksys Avatar answered Oct 24 '22 05:10

Kroksys