> Canonical guide: https://developers.foxlight.ai/build/sdk/reference/serving/
> Contract snapshots: Skulk 2.0.0 (b0af39c79b6b7102b2478062904f1d7cc8619975); SDK 0.4.0 (31bb090b8f64689f87514e48385e22b6ad94a6c2). Check the installed runtime when versions differ.

# serving API

SDK 0.4.0. This reference describes the supported authoring interface.

## `bind_hosts`

The addresses a child's server listens on: loopback, then the serve address.

Bind each one separately. Binding every interface would also accept the
local network, which the host did not choose to serve.

```python
def bind_hosts(startup: Startup) -> tuple[str, ...]:
    ...
```

## `advertised_host`

The host part of the URL a child publishes: the serve address, else loopback.

An IPv6 serve address comes back in brackets, ready to go into a URL.

```python
def advertised_host(startup: Startup) -> str:
    ...
```

## `peer_allowed`

Whether a connection from `address` may be served.

Loopback callers are on the node. Tailscale callers reached the node
through its tailnet. Every other caller is refused, including the local
network, as is anything that is not an IP address. An IPv4 caller seen
through an IPv6 socket (`::ffff:100.64.0.1`) is judged by its IPv4
address, and an IPv6 zone suffix (`%en0`) is ignored.

```python
def peer_allowed(address: str) -> bool:
    ...
```
