var hosts = ["alpha.example.com", "beta.example.com"];
var index = -1;
function failover_fn() {
index += 1;
if (index == hosts.length) index = 0;
return {host: hosts[index].hostname};
};
var opts = {
host: "example.com",
connection_details: failover_fn
}
container.connect(opts);
var hosts = ["alpha.example.com", "beta.example.com"];
var index = -1;
function failover_fn() {
index += 1;
if (index == hosts.length) index = 0;
return {host: hosts[index].hostname};
};
var opts = {
host: "example.com",
connection_details: failover_fn
}
container.connect(opts);
Copy to ClipboardCopied!Toggle word wrapToggle overflow