summaryrefslogtreecommitdiffstats
path: root/test/AFB.js
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2016-05-29 23:41:40 +0200
committerFulup Ar Foll <fulup@iot.bzh>2016-05-29 23:41:40 +0200
commit26bca5f8a8c6f9403a84945a5cd914b6da948efd (patch)
tree88469dc3eaa063b3d773d5221fe3cb67e9b04cc0 /test/AFB.js
parent706bc5c7e0db5f7a782f80ab99fa8fe005289f8d (diff)
parent2ea7ffb3abc8c62cfd5235ba4dbcd040f0235d69 (diff)
Merge branch 'master' of https://github.com/iotbzh/afb-daemon
Diffstat (limited to 'test/AFB.js')
-rw-r--r--test/AFB.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/AFB.js b/test/AFB.js
index ae2fd8b8..c77e5e60 100644
--- a/test/AFB.js
+++ b/test/AFB.js
@@ -42,7 +42,13 @@ var AFB_websocket;
var PROTO1 = "x-afb-ws-json1";
AFB_websocket = function(onopen, onabort) {
- this.ws = new WebSocket(urlws, [ PROTO1 ]);
+ var u = urlws;
+ if (AFB_context.token) {
+ u = u + '?x-afb-token=' + AFB_context.token;
+ if (AFB_context.uuid)
+ u = u + '&x-afb-uuid=' + AFB_context.uuid;
+ }
+ this.ws = new WebSocket(u, [ PROTO1 ]);
this.pendings = {};
this.awaitens = {};
this.counter = 0;