WasiNetworkPolicy

class WasiNetworkPolicy(httpEndpoints: Set<WasiHttpNetworkEndpoint> = emptySet(), rawSocketEndpoints: Set<WasiNetworkEndpoint> = emptySet())

Explicit network capabilities granted to a WASI Preview 3 host.

HTTP and raw sockets are independent. Empty endpoint sets deny all network access. Matching is exact after ASCII hostname/IP normalization; wildcard and suffix matching are deliberately not supported.

Constructors

Link copied to clipboard
constructor(httpEndpoints: Set<WasiHttpNetworkEndpoint> = emptySet(), rawSocketEndpoints: Set<WasiNetworkEndpoint> = emptySet())

Types

Link copied to clipboard
object Companion

Properties

Functions

Link copied to clipboard
fun allowsHttp(protocol: WasiHttpNetworkProtocol, host: String, port: Int): Boolean
Link copied to clipboard
fun allowsRawSocket(host: String, port: Int): Boolean