From 0032ff9f3680782d4d8f287e58627c6ec97fca27 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 22 Aug 2019 23:36:36 +0200 Subject: support code for NFC tunneling --- src/headless/helpers.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/headless/helpers.ts') 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"); -- cgit v1.2.3