Connection

Connect to a remote server.

new Connection(options)

Create a server to be able to connect remotely.

ParameterDefaultDescription

options

Object (optional) Connection options.

options.address

String The address of the server to connect to.

options.authorization

String Your authorization settings to authenticate yourself on the server side.

options.authorization.username

String Username in the list of users specified in the server option.

options.authorization.password

String Password in the list of users specified in the server option.

options.auto_reconnect

true

Boolean (optional) Whether to auto-reconnect when disconnected.

options.auto_reconnect_interval

5

Number (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