File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
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 = [ ] ;
109109 $WebSocket . prototype . _connect = function _connect ( force ) {
110110 if ( force || ! this . socket || this . socket . readyState !== this . _readyStateConstants . OPEN ) {
111111 this . socket = $websocketBackend . create ( this . url , this . protocols ) ;
112+ this . socket . binaryType = this . binaryType ;
112113 this . socket . onmessage = angular . bind ( this , this . _onMessageHandler ) ;
113114 this . socket . onopen = angular . bind ( this , this . _onOpenHandler ) ;
114115 this . socket . onerror = angular . bind ( this , this . _onErrorHandler ) ;
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