Net

external interface Net(source)

Properties

Link copied to clipboard
abstract external val online: Boolean

A boolean property. Whether there is currently internet connection.

Link copied to clipboard
abstract external var WebSocket: Any

A typeof WebSocket reference to the WebSocket class, which can be used to create WHATWG-compatible WebSocket connections through Chromium's network stack from the main process.

Functions

Link copied to clipboard
abstract external fun fetch(input: String, init: NetFetchInit = definedExternally): Promise<GlobalResponse>
abstract external fun fetch(input: GlobalRequest, init: NetFetchInit = definedExternally): Promise<GlobalResponse>

see Response.

Link copied to clipboard
abstract external fun isOnline(): Boolean

Whether there is currently internet connection.

Link copied to clipboard
abstract external fun request(options: ClientRequestConstructorOptions): ClientRequest
abstract external fun request(options: String): ClientRequest

Creates a ClientRequest instance using the provided options which are directly forwarded to the ClientRequest constructor. The net.request method would be used to issue both secure and insecure HTTP requests according to the specified protocol scheme in the options object.

Link copied to clipboard
abstract external fun resolveHost(host: String, options: ResolveHostOptions = definedExternally): Promise<ResolvedHost>

Resolves with the resolved IP addresses for the host.