Methods
bespokenServer
- bespokenServer(host: string, port: number): BSTProxy
-
Parameters
-
host: string
-
port: number
start
- start(onStarted?: function): void
-
Parameters
-
Optional onStarted: function
Returns void
startWithConfig
- startWithConfig(onStarted?: function): BSTProxy
-
Parameters
-
Optional onStarted: function
stop
- stop(onStopped?: function): void
-
Parameters
-
Optional onStopped: function
Returns void
Static cloudFunction
- cloudFunction(functionFile: string, functionName?: string): BSTProxy
-
Parameters
-
functionFile: string
-
Optional functionName: string
Static lambda
- lambda(lambdaFile?: string, functionName?: string): BSTProxy
-
Parameters
-
Optional lambdaFile: string
-
Optional functionName: string
Exposes the BST proxy command for use.
The proxy creates a tunnel to the Bespoken Proxy server.
To start it a proxy programmatically, simply call:
const proxy = BSTProxy.lambda("index.js").("SECRET_KEY").start(() => { // Stuff to do on start });
To stop, call:
proxy.stop(() => { // Stuff to do on stop // If being used in unit tests, good to wait for this to ensure resources are properly cleaned up });
Your secret key can be found in the ~/.bst/config file.