File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 4141 this . url = url || 'Missing URL' ;
4242 this . ssl = / ( w s s ) / i. test ( this . url ) ;
4343
44- // this.binaryType = '';
4544 // this.extensions = '';
4645 // this.bufferedAmount = 0;
4746 // this.trasnmitting = false;
5453 this . initialTimeout = options && options . initialTimeout || 500 ; // 500ms
5554 this . maxTimeout = options && options . maxTimeout || 5 * 60 * 1000 ; // 5 minutes
5655 this . reconnectIfNotNormalClose = options && options . reconnectIfNotNormalClose || false ;
56+ this . binaryType = options && options . binaryType || 'blob' ;
5757
5858 this . _reconnectAttempts = 0 ;
5959 this . sendQueue = [ ] ;
113113 this . socket . onopen = angular . bind ( this , this . _onOpenHandler ) ;
114114 this . socket . onerror = angular . bind ( this , this . _onErrorHandler ) ;
115115 this . socket . onclose = angular . bind ( this , this . _onCloseHandler ) ;
116+ this . socket . binaryType = this . binaryType ;
116117 }
117118 } ;
118119
121122 var data = this . sendQueue . shift ( ) ;
122123
123124 this . socket . send (
124- isString ( data . message ) ? data . message : JSON . stringify ( data . message )
125+ data . message
125126 ) ;
126127 data . deferred . resolve ( ) ;
127128 }
Original file line number Diff line number Diff line change 4141 this . url = url || 'Missing URL' ;
4242 this . ssl = / ( w s s ) / i. test ( this . url ) ;
4343
44- // this.binaryType = '';
4544 // this.extensions = '';
4645 // this.bufferedAmount = 0;
4746 // this.trasnmitting = false;
5453 this . initialTimeout = options && options . initialTimeout || 500 ; // 500ms
5554 this . maxTimeout = options && options . maxTimeout || 5 * 60 * 1000 ; // 5 minutes
5655 this . reconnectIfNotNormalClose = options && options . reconnectIfNotNormalClose || false ;
56+ this . binaryType = options && options . binaryType || 'blob' ;
5757
5858 this . _reconnectAttempts = 0 ;
5959 this . sendQueue = [ ] ;
113113 this . socket . onopen = angular . bind ( this , this . _onOpenHandler ) ;
114114 this . socket . onerror = angular . bind ( this , this . _onErrorHandler ) ;
115115 this . socket . onclose = angular . bind ( this , this . _onCloseHandler ) ;
116+ this . socket . binaryType = this . binaryType ;
116117 }
117118 } ;
118119
121122 var data = this . sendQueue . shift ( ) ;
122123
123124 this . socket . send (
124- isString ( data . message ) ? data . message : JSON . stringify ( data . message )
125+ data . message
125126 ) ;
126127 data . deferred . resolve ( ) ;
127128 }
You can’t perform that action at this time.
0 commit comments