Skip to main content

Module address_policy

Module address_policy 

Source
Expand description

Which addresses a page in the server’s Chromium may connect to. The browser opens pages from the web on a machine that holds the user’s workspace, so everything it connects to goes through address_proxy, which asks this module about each address it is about to connect to, after it has resolved the name itself. Plain data and functions, so every rule is tested without a network.

Refused: this server’s own listening ports on the loopback address, every private, link-local (the cloud metadata addresses among them), shared, documentation, multicast and reserved range, IPv6 forms that embed an IPv4 address (translated, 6to4, Teredo), and port 0. Allowed: the public internet, and other ports on the loopback address (a development server the user runs in the same workspace).

Constants§

DENY_PORTS_ENV
Other loopback ports the person who runs this server wants kept from pages (a gateway or another service in the same network namespace), as a comma-separated list. Read by the server’s own process: a page, or an agent, cannot set it.

Statics§

OWN_PORTS 🔒
The ports this server listens on, noted as each listener binds. A page may never connect to one of them, whatever address it names for this machine.

Functions§

check
Whether a page may connect to ip on port; the reason in words when it may not. own_ports are this server’s own listening ports.
note_own_port
Note a port this server listens on.
note_ports_from_env
Note the ports DENY_PORTS_ENV names.
own_ports
The ports noted so far.
parse_ports
The ports in a comma-separated list; anything that is not a port number is skipped.
plain 🔒
The address with an IPv4 address written as IPv6 (::ffff:a00:1) read as the IPv4 one it is.
v4_refused 🔒
v6_refused 🔒