1.0.0 • Published 8 years ago
redis-ssh v1.0.0
Redis SSH
Sets up a Redis connection inside an SSH tunnel.
API
.connect(obj sshConfig, obj redisConfig)
sshConfigshould be an object according to thessh2package.redisConfigshould be an object according to theredispackage.- Returns a Object, containing a
clientfrom theredispackage andclosefunction.
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
8 years ago