Skip to content

nicolazj/redis-ssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redis SSH

Sets up a Redis connection inside an SSH tunnel.

API

.connect(obj sshConfig, obj redisConfig)

  • sshConfig should be an object according to the ssh2 package.
  • redisConfig should be an object according to the redis package.
  • Returns a Object, containing a client from the redis package and close 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();
  });
}

About

redis ssh tunnel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published