1.0.0 • Published 7 years ago
redis-ssh v1.0.0
Redis SSH
Sets up a Redis connection inside an SSH tunnel.
API
.connect(obj sshConfig, obj redisConfig)
sshConfig
should be an object according to thessh2
package.redisConfig
should be an object according to theredis
package.- Returns a Object, containing a
client
from theredis
package andclose
function.
Usage
Don't forget to close()
the tunnel connection when you're done with redis.
const Redis = require('redis-ssh');
async function main() {
const { client, close } = await Redis.connect(
{
host: '',
user: '',
privateKey: fs.readFileSync('./*.pem'),
},
{
host: '',
port: 0,
password: '',
}
);
client.doSomething('', function() {
close();
});
}
1.0.0
7 years ago