A socket defines a connection to a nats server
Representation of a Nats connection properties
Initialize a Socket with a unique ID and a endpoint url
The 'sid' can be used in various places of the API to choose which socket should handle an effect or a subscription.
Set this socket as the default one
If an app has several opened sockets, one must be the default one. By default, the default socket is the first to be opened. This function can be used to designate an arbitrary socket as the default one.
If several sockets have this flag, one of them will be picked
Enable/disable debug mode on the socket
If the Config debug is on, all sockets will have debug enabled no matter what value is given to this function.
Build the smallest ConnectOptions possible
You generally want to combine it with 'withUserPass' or 'withAuthToken'
Authenticate with a auth token
Authenticate with a username and a password
Possible statuses of a socket