Connection

Connect to a remote server.

new Connection(options)

Create a server to be able to connect remotely.

Parameter
Default
Description

options

Objectarrow-up-right (optional) Connection options.

options.address

Stringarrow-up-right The address of the server to connect to.

options.authorization

Stringarrow-up-right Your authorization settings to authenticate yourself on the server side.

options.authorization.username

Stringarrow-up-right Username in the list of users specified in the server option.

options.authorization.password

Stringarrow-up-right Password in the list of users specified in the server option.

options.auto_reconnect

true

Booleanarrow-up-right (optional) Whether to auto-reconnect when disconnected.

options.auto_reconnect_interval

5

Numberarrow-up-right (optional) Interval of seconds it will try to reconnect after disconnection.

Example:

const example_connection = new <PeakDB>.Connection({
  "address": "127.0.0.1:4951",
  "authorization": {
    "username": "fir4tozden",
    "password": "ZdJuTNqUXpqNrw2H"
  },
  "auto_reconnect": true,
  "auto_reconnect_interval": 5
});

Last updated