Skip to content

Commit 9b12d04

Browse files
committed
Fixed bug on connect.websocket transport no storing the api before create the instance
1 parent f549d95 commit 9b12d04

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

dist/browser.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ var connectWebsocket = function websocket(dop, node, options) {
155155
url = protocol+'://'+domain_prefix[2].toLocaleLowerCase()+'/'+dop.name;
156156
}
157157

158-
var socket = new options.transport.api(url),
158+
var api = options.transport.api(),
159+
socket = new api(url),
159160
send = socket.send,
160161
send_queue = [];
161162

@@ -190,7 +191,9 @@ var connectWebsocket = function websocket(dop, node, options) {
190191
if (typeof dop=='undefined' && typeof module == 'object' && module.exports)
191192
module.exports = connectWebsocket;
192193
else if (typeof window != 'undefined')
193-
connectWebsocket.api = window.WebSocket;
194+
connectWebsocket.api = function() {
195+
return window.WebSocket;
196+
};
194197

195198

196199

0 commit comments

Comments
 (0)