iniquity

A re-imagining of the iconic BBS software.

View on GitHub

Class: IQNetwork

network.IQNetwork

IQNetwork class for inter-BBS and external connectivity

Table of contents

Constructors

Methods

Constructors

constructor

new IQNetwork()

Defined in

core/src/network.ts:71

Methods

connectTelnet

connectTelnet(options): Promise<Socket>

Connect to a telnet server

Parameters

Name Type
options INetworkConnectionOptions

Returns

Promise<Socket>

Defined in

core/src/network.ts:264


get

get(url): Promise<string>

Simple GET request

Parameters

Name Type
url string

Returns

Promise<string>

Defined in

core/src/network.ts:244


getLocalAddress

getLocalAddress(): null | IFidoAddress

Get local FidoNet address

Returns

null | IFidoAddress

Defined in

core/src/network.ts:83


getNode

getNode(id): undefined | INetworkNode

Get a network node

Parameters

Name Type
id string

Returns

undefined | INetworkNode

Defined in

core/src/network.ts:123


getOfflineNodes

getOfflineNodes(): INetworkNode[]

Get offline nodes

Returns

INetworkNode[]

Defined in

core/src/network.ts:299


getOnlineNodes

getOnlineNodes(): INetworkNode[]

Get online nodes

Returns

INetworkNode[]

Defined in

core/src/network.ts:292


httpRequest

httpRequest(url, options?): Promise<{ body: string ; headers: Record<string, string> ; status: number }>

Make HTTP/HTTPS request

Parameters

Name Type
url string
options? Object
options.body? string
options.headers? Record<string, string>
options.method? string
options.timeout? number

Returns

Promise<{ body: string ; headers: Record<string, string> ; status: number }>

Defined in

core/src/network.ts:193


listNodes

listNodes(): INetworkNode[]

List all nodes

Returns

INetworkNode[]

Defined in

core/src/network.ts:130


ping

ping(host, port, timeout?): Promise<boolean>

Check if a host is reachable

Parameters

Name Type Default value
host string undefined
port number undefined
timeout number 5000

Returns

Promise<boolean>

Defined in

core/src/network.ts:137


post

post(url, body, contentType?): Promise<string>

Simple POST request

Parameters

Name Type Default value
url string undefined
body string undefined
contentType string "application/json"

Returns

Promise<string>

Defined in

core/src/network.ts:252


registerNode

registerNode(node): void

Register a network node

Parameters

Name Type
node INetworkNode

Returns

void

Defined in

core/src/network.ts:116


setLocalAddress

setLocalAddress(address): void

Set local FidoNet address

Parameters

Name Type
address IFidoAddress

Returns

void

Defined in

core/src/network.ts:76


updateAllNodeStatuses

updateAllNodeStatuses(): Promise<Map<string, boolean>>

Update all node statuses

Returns

Promise<Map<string, boolean>>

Defined in

core/src/network.ts:179


updateNodeStatus

updateNodeStatus(nodeId): Promise<boolean>

Update node status

Parameters

Name Type
nodeId string

Returns

Promise<boolean>

Defined in

core/src/network.ts:165


formatFidoAddress

Static formatFidoAddress(address): string

Format FidoNet address to string

Parameters

Name Type
address IFidoAddress

Returns

string

Defined in

core/src/network.ts:105


parseFidoAddress

Static parseFidoAddress(address): null | IFidoAddress

Parse FidoNet address string (zone:net/node.point)

Parameters

Name Type
address string

Returns

null | IFidoAddress

Defined in

core/src/network.ts:90