@igloosoftware/ig-proxy
v2.1.0
Published
Igloo API/Resource Proxy server
Downloads
3
Readme
Igloo API Proxy Server
A simple proxy harness that proxies local requests to a Digital Workplace and handles authentication and authorization.
Prerequisites
You or a member of your team will need to obtain an appId
and appPass
) value from Igloo Customer Support.
You will need administration access to the digital workplace that you will be testing on.
Install
- install the package into a new or existing project
npm i @igloosoftware/ig-proxy
Create a proxy-config.json
(or similarly named) file with your Digital Workplace credentials.
Remember to never commit this file.
Sample proxy-config.json
{
"appId": "The AppID provided by Igloo Support",
"appPass": "The AppPass provided by Igloo Support",
"username": "[email protected]",
"password": "yourSecurePassword",
"dwpDomain": "my-dpw-url.igloocommunities.com",
"authVersion": "AUTH_VERSION"
}
Note the URL in dwpDomain
should not include the scheme (https://). authVersion
is always going to default to v2 unless specified otherwise in your config.
Basic Usage
The most basic usage you can provide a config object or path to your proxy-config
require('@igloosoftware/ig-proxy')('./proxy-config.json');
// or more explicitly
const startProxy = require('@igloosoftware/ig-proxy');
startProxy('./proxy-config.json');
Advanced Usage
You can also create a proxy instance as part of a larger development harness.
const igProxy = require('@igloosoftware/ig-proxy');
async function start() {
const config = await igProxy({
appId: '...',
appPass: '...',
username: '...',
password: '...',
dwpDomain: '...',
authVersion: '1',
keepAliveSec: 60,
});
console.log(`Igloo proxy sever listening on ${config.port}`);
}
// start your harness and proxy
start();