Table of Contents

Class WebHostCreateParams

Namespace
VpnHood.AppLib.App.WebHosting
Assembly
VpnHood.AppLib.App.dll

Provides what a web host is made with (IAppWebHostFactory): the API it puts on HTTP, the page and the UI's files it serves, the port, and how it behaves. The app makes one for each host, as the two are not told the same.

public class WebHostCreateParams
Inheritance
WebHostCreateParams
Inherited Members

Remarks

The host does as it is told rather than infer, so the server half names nothing of the engine and builds against the API alone.

Properties

Api

Gets the app's API, the same instance for every transport, so a paired browser and the device's own UI agree.

public required VpnHoodApi Api { get; init; }

Property Value

VpnHoodApi

AppName

Gets the app's name, which the host writes into its page, as the page is every app's and names none.

public required string AppName { get; init; }

Property Value

string

IsAlwaysOn

Gets a value indicating whether the host stays up for the life of the process, whether or not anything asked, and refuses to stop: true only for the remote host a developer opened.

public required bool IsAlwaysOn { get; init; }

Property Value

bool

IsTokenRequired

Gets a value indicating whether the host asks a caller for its token: the remote host's pairing, or on the local host the token its own address carries, which an API call sends as a bearer token.

public required bool IsTokenRequired { get; init; }

Property Value

bool

Remarks

false is the developer's open door: in a Debug build, and for the remote host with the RemoteAccess command too, where there is no screen to read a pairing from.

LogoAssetPath

Gets the path of the app's logo in the UI's files (LogoAssetPath), which the host writes into its page.

public required string LogoAssetPath { get; init; }

Property Value

string

UiAssetProvider

Gets the files the app's UI draws from, which the host serves at /assets/ to a paired phone's page, the instance the app's own UI reads (UiAssetProvider), or null for a UI that brings none of its own.

public IAssetProvider? UiAssetProvider { get; init; }

Property Value

IAssetProvider

UiTheme

Gets the look's name (UiTheme), whose colours the host reads from the UI's files and writes into its page.

public required string UiTheme { get; init; }

Property Value

string

WebHostPort

Gets the port the host prefers: the local host takes another where it is not free; the remote host keeps to it unless it can bind it on no address at all, and then takes a free one.

public required int WebHostPort { get; init; }

Property Value

int

WebRoot

Gets the page the host serves, index.html at its root, to this device and to a paired one alike: the UI's browser build, as the head shipped it (WebRootZipAsset), the same instance for both hosts.

public required IAssetProvider WebRoot { get; init; }

Property Value

IAssetProvider