Difference between http://+:8080/ and http://*:8080/
Asked Answered
C

2

11

What are the differences between these two prefixes in terms of HttpListener or any other?

http://+:8080/

http://*:8080/
Coadjutrix answered 27/2, 2012 at 3:23 Comment(4)
How is this related to ASp.NET in any way given that this is http.sys in the kernel that takes and handles those?Nappie
Some people from Microsoft misunderstood that it is under ASP.NET and they by mistake mentioned it in this link msdn.microsoft.com/en-us/library/system.net.httplistener.aspxCoadjutrix
Still not Asp.net, you know. System.Net is the network part (not asp.net specific) and they clearly state this goes to http.sys. Try reading more than one line and understanding it, please.Nappie
Possible duplicate of What's the difference between http://*:80 and http://+:80Whencesoever
C
18

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.

Coxa answered 27/2, 2012 at 3:27 Comment(2)
will like you explain it with an example or with link ? whatever you likeCoadjutrix
Thank you for the explanation! The official documentation is not very clear in this detail.Steiger
S
1

In addition to @Paulpro's great answer, the link posted by @rownage (see this answer) provides some more information about the difference:

Strong wildcard (Plus Sign +)

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.

A strong wildcard is useful when an application needs to serve requests addressed to one or more relativeURIs, regardless of how those requests arrive on the machine or what site they specify in their Host headers. Use of a strong wildcard in this situation avoids the need to specify an exhaustive list of host and/or IP-addresses.

Weak wildcard (Asterisk *)

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.

Steiger answered 22/1, 2015 at 13:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.