Skip to main content

Module server

Module server 

Source
Expand description

Local server used to communicate with the peer core. Handles external client connections (HTTP/WebSocket).

This module acts as the bridge between external clients and the Freenet node’s core logic. It parses ClientRequests, sends them to the main node event loop (node::Node) via an internal channel, and forwards HostResponses back to the clients.

See ../architecture.md for its place in the overall architecture.

Structs§

OriginContract
Represents an origin contract entry with metadata for token expiration.
WebApp

Functions§

is_private_ip
Returns true if the IP is a private/local address suitable for LAN access.
serve_client_api
serve_client_api_for_test
Serves the client API and returns the concrete types (for integration testing). This allows tests to access internal state like the origin_contracts map.
serve_client_api_with_listener
Like serve_client_api but reuses a pre-bound TCP listener, avoiding the release-then-rebind race window that causes port conflicts in parallel tests.
serve_client_api_with_listener_and_contracts
Like serve_client_api_with_listener but also returns the OriginContractMap.
validate_source_cidr
Validates a single operator-supplied CIDR for the local-API allowlist.

Type Aliases§

OriginContractMap
Maps authentication tokens to origin contract metadata.