Egress
A site's code can send a request only to the hostnames on its egress list. A new site has an empty list, so its code can send no request at all.
This is about fetch() from the site's own code. Pages, forms, payments
and mail do not need the list.
Read the list
GET /v1/sites/{id}/egress
{ "hosts": ["api.example.com"] }
Change the list
The list is egress in the site's clave.site.json, and a publish sets
it. Read Site settings.
{ "egress": ["api.example.com", "hooks.example.org"] }
- Give hostnames only: no
https://, no path, no port, no*. - A name matches exactly.
example.comdoes not let code reachapi.example.com. - A site can name at most 20 hostnames.
- An empty list removes every host.
A draft has its own list, from the file on its slot.
A request to a host that is not on the list gets a 403 in the site's
code, with a message that names the host.