In MDN's proxy example, I have seen that they use 127.0.0.1:65535
as an invalid url
(link to the source):
const allow = "DIRECT";
const deny = "PROXY 127.0.0.1:65535";
...
function FindProxyForURL(url, host) {
if (blockedHosts.indexOf(host) != -1) {
browser.runtime.sendMessage(`Proxy-blocker: blocked ${url}`);
return deny;
}
return allow;
}
Is there anything special about port 65535? Is it safe to assume that no process will ever listen to that port?
In the documentation of Proxy Auto-Configuration (PAC) files, I did not see a straightforward way to block requests otherwise. For instance, there is DIRECT
, PROXY
, SOCKS
but no REJECT
or DENY
. I assume that PROXY 127.0.0.1:65535
is the official way to deny requests.
Is it safe to assume that sending requests to 127.0.0.1:65535
will reject them?