File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,11 @@ export default class Binance {
261261 return this . stream ;
262262 }
263263
264+ getFStreamUrl ( ) {
265+ if ( this . Options . test ) return this . fstreamSingleTest ;
266+ return this . fstreamSingle ;
267+ }
268+
264269 uuid22 ( a ?: any ) {
265270 return a ? ( a ^ Math . random ( ) * 16 >> a / 4 ) . toString ( 16 ) : ( ( [ 1e7 ] as any ) + 1e3 + 4e3 + 8e5 ) . replace ( / [ 0 1 8 ] / g, this . uuid22 ) ;
266271 }
@@ -1457,14 +1462,14 @@ export default class Binance {
14571462 host : this . parseProxy ( socksproxy ) [ 1 ] ,
14581463 port : this . parseProxy ( socksproxy ) [ 2 ]
14591464 } ) ;
1460- ws = new WebSocket ( ( this . Options . test ? this . fstreamSingleTest : this . fstreamSingle ) + endpoint , { agent } ) ;
1465+ ws = new WebSocket ( ( this . getFStreamUrl ( ) ) + endpoint , { agent } ) ;
14611466 } else if ( httpsproxy ) {
14621467 const config = url . parse ( httpsproxy ) ;
14631468 const agent = new HttpsProxyAgent ( config ) ;
14641469 if ( this . Options . verbose ) this . Options . log ( `futuresSubscribeSingle: using proxy server: ${ agent } ` ) ;
1465- ws = new WebSocket ( ( this . Options . test ? this . fstreamSingleTest : this . fstreamSingle ) + endpoint , { agent } ) ;
1470+ ws = new WebSocket ( ( this . getFStreamUrl ( ) ) + endpoint , { agent } ) ;
14661471 } else {
1467- ws = new WebSocket ( ( this . Options . test ? this . fstreamSingleTest : this . fstreamSingle ) + endpoint ) ;
1472+ ws = new WebSocket ( ( this . getFStreamUrl ( ) ) + endpoint ) ;
14681473 }
14691474
14701475 if ( this . Options . verbose ) this . Options . log ( 'futuresSubscribeSingle: Subscribed to ' + endpoint ) ;
You can’t perform that action at this time.
0 commit comments