https://github.com/kmoskwiak/proxy-session-store
Proxy session store for express-session allows to use any session store through http API.
https://github.com/kmoskwiak/proxy-session-store
cookies express express-session proxy sessionstore
Last synced: 2 months ago
JSON representation
Proxy session store for express-session allows to use any session store through http API.
- Host: GitHub
- URL: https://github.com/kmoskwiak/proxy-session-store
- Owner: kmoskwiak
- Created: 2018-01-31T23:25:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-31T23:29:18.000Z (over 8 years ago)
- Last Synced: 2025-06-30T15:46:12.587Z (12 months ago)
- Topics: cookies, express, express-session, proxy, sessionstore
- Language: JavaScript
- Size: 1.95 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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

## Setup
```
npm install proxy-session-store
```
In express app:
```js
var session = require('express-session');
var ProxySessionStore = require('proxy-session-store')(session);
app.use(session({
store: new ProxySessionStore({
port: 9999,
hostname: 'localhost',
body: {
apiKey: '',
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:
```js
{
apiKey: '',
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