File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ class Connection extends EventEmitter {
16
16
constructor ( url , options = { } ) {
17
17
super ( ) ;
18
18
this . _url = url ;
19
+ this . _trace = options . trace ;
19
20
this . _proxyURL = options . proxy ;
20
21
this . _proxyAuthorization = options . proxyAuthorization ;
21
22
this . _authorization = options . authorization ;
@@ -52,6 +53,9 @@ class Connection extends EventEmitter {
52
53
53
54
_onMessage ( message ) {
54
55
let parameters ;
56
+ if ( this . _trace ) {
57
+ console . log ( message ) ;
58
+ }
55
59
try {
56
60
parameters = this . _parseMessage ( message ) ;
57
61
} catch ( error ) {
@@ -191,6 +195,9 @@ class Connection extends EventEmitter {
191
195
}
192
196
193
197
_send ( message ) {
198
+ if ( this . _trace ) {
199
+ console . log ( message ) ;
200
+ }
194
201
return new Promise ( ( resolve , reject ) => {
195
202
this . _ws . send ( message , undefined , ( error , result ) => {
196
203
if ( error ) {
You can’t perform that action at this time.
0 commit comments