WasiHostHttpClientOptions Class

The rules of a WasiHostHttpClient: which requests the component can send over the network of the machine.

public sealed class WasiHostHttpClientOptions

Remarks

By default, the component cannot send any request: give it only the access it needs.

Constructors

NameDescription
WasiHostHttpClientOptions()

WasiHostHttpClientOptions()

WasiHttpClient.cs
public WasiHostHttpClientOptions()

No documentation is available.

Properties

NameDescription
AddressCheckGets the check of the IP addresses that the client connects to (WasiSocketAddressUse.TcpConnect), or null to allow every address. Check the addresses to prevent a host name from leading to the machines of the local network (such as WasiHostNetworkOptions.AllowLoopback, or a check that denies the private addresses).
AllowAllGets a check that allows every request.
ConnectTimeoutGets the timeout of the connections when the request does not set one (connect-timeout). The default is 30 seconds.
RequestCheckGets the check of the requests, or null to deny every request.

AddressCheck

WasiHttpClient.cs

Gets the check of the IP addresses that the client connects to (WasiSocketAddressUse.TcpConnect), or null to allow every address. Check the addresses to prevent a host name from leading to the machines of the local network (such as WasiHostNetworkOptions.AllowLoopback, or a check that denies the private addresses).

public WasiSocketAddressCheck? AddressCheck { get; init; }

Gets a check that allows every request.

public static WasiHttpRequestCheck AllowAll { get; }

Property value

WasiHttpRequestCheck

ConnectTimeout

WasiHttpClient.cs

Gets the timeout of the connections when the request does not set one (connect-timeout). The default is 30 seconds.

public TimeSpan ConnectTimeout { get; init; }

Property value

TimeSpan

RequestCheck

WasiHttpClient.cs

Gets the check of the requests, or null to deny every request.

public WasiHttpRequestCheck? RequestCheck { get; init; }

Property value

WasiHttpRequestCheck?

Methods

NameDescription
AllowHosts(string[])Returns a check that allows the requests to some hosts (compared without case), such as api.example.com.

AllowHosts(string[])

WasiHttpClient.cs

Returns a check that allows the requests to some hosts (compared without case), such as api.example.com.

public static WasiHttpRequestCheck AllowHosts(params string[] hosts)

Parameters

hosts string[]
The host names or IP addresses, without port.

Returns

WasiHttpRequestCheck