Egress
Read and update runtime outbound network policy.
EgressManager declaration
Section titled “EgressManager declaration”class EgressManagerEgressManager access
Section titled “EgressManager access”This type is created by the SDK; do not construct it directly.
const manager = runtime.egress;EgressManager methods
Section titled “EgressManager methods”Return the cached egress policy.
EgressManager.get(): Promise<EgressPolicy>Returns
Section titled “Returns”Promise<EgressPolicy>
setPolicy()
Section titled “setPolicy()”Replace the complete egress policy and return refreshed runtime metadata.
EgressManager.setPolicy(policy: EgressPolicy): Promise<RuntimeInfo>Parameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
policy | EgressPolicy | Required | Egress policy to apply. |
Returns
Section titled “Returns”Promise<RuntimeInfo>
Examples
Section titled “Examples”await runtime.egress.setPolicy({ mode: "allowlist", allowedHosts: ["api.github.com"], deniedHosts: [],});EgressPolicy
Section titled “EgressPolicy”Describes which outbound hosts a runtime may or may not reach.
EgressPolicy declaration
Section titled “EgressPolicy declaration”interface EgressPolicyEgressPolicy properties
Section titled “EgressPolicy properties”| Name | Type | Description |
|---|---|---|
allowedHosts | string[] | Hosts explicitly allowed by the policy. |
deniedHosts | string[] | Hosts explicitly denied by the policy. |
mode | EgressMode | Whether the policy uses an allowlist or denylist. |