Git Product home page Git Product logo

proxy-session-store's Introduction

HTTP Proxy Session Store

Proxy session store for express-session allows to use any session store through http API.

It can be used to:

  • share any session store between multiple applications,
  • reach session store through HTTP Api

Proxy Session Store

Setup

npm install proxy-session-store

In express app:

var session = require('express-session');
var ProxySessionStore = require('proxy-session-store')(session);

app.use(session({
           store: new ProxySessionStore({
               port: 9999,
               hostname: 'localhost',
               body: {
                   apiKey: '<api_key>',
                   someOtherOptionalKey: 'which you want to pass to session store'
               }
           }),
           secret: 'keyboard cat'
       }
   ));

In above example Proxy Session Store will send POST request to server listening on http://localhost:9999. Body of POST request in this example looks like this:

{
   apiKey: '<api_key>',
   someOtherOptionalKey: 'which you want to pass to session store',
   body: 'SESSION DATA'
}

Avaliable options

  • port - port of service with exposed HTTP API
  • hostname - hostname of service with exposed HTTP API
  • body - OPTIONAL - any additional data which should be send in HTTP request

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.