What is phrase “URL reservation in HTTP.SYS” means

2019-04-12 12:45发布

问题:

Can't understand the meaning of this phrase. People on forums suggests each other to reserve url in HTTP.sys, but what does it mean? What is it for? How does it works? All it comes from HttpWebRequest uac problems.

回答1:

Several Win32 APIs and .NET framework components (such as WCF) utilize the HTTP Server API when they want to send or receive HTTP requests targeted at the local machine. The HTTP Server API basically provides such functionality in a manner managed by the OS without the need for deploying a standalone web server such as IIS on the machine.

At this point it's probably best to quote the Dev Center page linked above:

A reservation persistently allocates a portion of the URL namespace to individual users allowing them to reserve or "own" that part of namespace. Reservations give the user the right to register to service requests for the namespace. The HTTP Server API ensures that users do not register URLs from portions of the namespace that they do not own. In order to ensure namespace security, ACLs (Access Control List) are applied to the portion of the namespace reserved for each user.

Reserved namespaces are identified by URL prefix strings, formatted in the same fashion as URL prefixes used for registrations. This means that all the various host specifier categories are also available for reservations.

Namespace reservations are persisted across reboots, and changes take effect dynamically so there is no need to stop and restart the machine.

What this means is that before the HTTP Server API allows you to listen to incoming requests to a particular URL namespace (think of that as a "URL path"), you have to register for them. Registration is performed on a user account basis as stated above, so what matters here is the user account under which the process that wants to listen to the request runs, which may be different than the account of the currently logged in user.