File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,11 @@ export default class WebSocketChannel {
31
31
* @param {ChannelConfig } config - configuration for this channel.
32
32
* @param {function(): string } protocolSupplier - function that detects protocol of the web page. Should only be used in tests.
33
33
*/
34
- constructor ( config , protocolSupplier = detectWebPageProtocol ) {
34
+ constructor (
35
+ config ,
36
+ protocolSupplier = detectWebPageProtocol ,
37
+ socketFactory = createWebSocket
38
+ ) {
35
39
this . _open = true
36
40
this . _pending = [ ]
37
41
this . _error = null
@@ -44,7 +48,7 @@ export default class WebSocketChannel {
44
48
return
45
49
}
46
50
47
- this . _ws = createWebSocket ( scheme , config . address )
51
+ this . _ws = socketFactory ( scheme , config . address )
48
52
this . _ws . binaryType = 'arraybuffer'
49
53
50
54
const self = this
You can’t perform that action at this time.
0 commit comments