aboutsummaryrefslogtreecommitdiff
path: root/src/headless
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-08-22 23:36:36 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-08-22 23:36:36 +0200
commit0032ff9f3680782d4d8f287e58627c6ec97fca27 (patch)
treeac003e943dacade62c75dc30bb9a2fe2437fc159 /src/headless
parentd76bc2a03d3f9ccf9c9cf142bcb03c96bb40ddb5 (diff)
support code for NFC tunneling
Diffstat (limited to 'src/headless')
-rw-r--r--src/headless/helpers.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/headless/helpers.ts b/src/headless/helpers.ts
index 7c4fa8777..9652c630f 100644
--- a/src/headless/helpers.ts
+++ b/src/headless/helpers.ts
@@ -120,6 +120,12 @@ export interface DefaultNodeWalletArgs {
* Handler for asynchronous notifications from the wallet.
*/
notifyHandler?: (reason: string) => void;
+
+ /**
+ * If specified, use this as HTTP request library instead
+ * of the default one.
+ */
+ httpLib?: HttpRequestLibrary;
}
/**
@@ -169,7 +175,12 @@ export async function getDefaultNodeWallet(
const myBridgeIdbFactory = new BridgeIDBFactory(myBackend);
const myIdbFactory: IDBFactory = (myBridgeIdbFactory as any) as IDBFactory;
- const myHttpLib = new NodeHttpLib();
+ let myHttpLib;
+ if (args.httpLib) {
+ myHttpLib = args.httpLib;
+ } else {
+ myHttpLib = new NodeHttpLib();
+ }
const myVersionChange = () => {
console.error("version change requested, should not happen");