Skip to content

Net

Net . urlEncode ( url binary )  -> string

Encodes the given string using URL encoding.

Parameters

url: string
binary: boolean?

Returns

string
Net . request ( config )  -> FetchResponse

Sends an HTTP request using the given url and / or parameters, and returns a dictionary that describes the response received.

Only throws an error if a miscellaneous network or I/O error occurs, never for unsuccessful status codes.

Parameters

config: string | FetchParams

Returns

FetchResponse
Net . tcpSocket ( url )  -> WebSocket

Connects to a TCP web socket at the given URL.

Throws an error if the server at the given URL does not support web sockets, or if a miscellaneous network or I/O error occurs.

Parameters

url: string

Returns

WebSocket
Net . udpSocket ( host port )  -> UdpSocket

Connects to a UDP web socket at the given URL.

Throws an error if the server at the given URL does not support web sockets, or if a miscellaneous network or I/O error occurs.

Parameters

host: string
port: number

Returns

UdpSocket