From a942dc7f879c96e0893eb4634064d6c4df49be9a Mon Sep 17 00:00:00 2001 From: saadataz Date: Thu, 18 May 2017 14:59:00 -0700 Subject: [PATCH] allow connecting to custom server --- examples/basic.ts | 1 + src/GameClient.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/basic.ts b/examples/basic.ts index 03edcb4..162fc51 100644 --- a/examples/basic.ts +++ b/examples/basic.ts @@ -72,6 +72,7 @@ function makeControls(amount: number): IControlData[] { client.open({ authToken: process.argv[2], versionId: parseInt(process.argv[3], 10), + url: process.argv[4] || null, }).then(() => { // Now we can create the controls, We need to add them to a scene though. // Every Interactive Experience has a "default" scene so we'll add them there there. diff --git a/src/GameClient.ts b/src/GameClient.ts index 94b60a1..2898aa0 100644 --- a/src/GameClient.ts +++ b/src/GameClient.ts @@ -34,7 +34,7 @@ export class GameClient extends Client { .then(endpoints => { return super.open({ authToken: options.authToken, - url: endpoints[0].address, + url: options.url || endpoints[0].address, extraHeaders: { 'X-Interactive-Version': options.versionId, },