@@ -624,9 +624,8 @@ Proxy.prototype._onWebSocketServerConnect = function(isSSL, ws, upgradeReq) {
624624 ctx . clientToProxyWebSocket . on ( 'pong' , self . _onWebSocketFrame . bind ( self , ctx , 'pong' , false ) ) ;
625625 ctx . clientToProxyWebSocket . on ( 'error' , self . _onWebSocketError . bind ( self , ctx ) ) ;
626626 ctx . clientToProxyWebSocket . on ( 'close' , self . _onWebSocketClose . bind ( self , ctx , false ) ) ;
627- if ( typeof ctx . clientToProxyWebSocket . pause === 'function' ) {
628- ctx . clientToProxyWebSocket . pause ( ) ;
629- }
627+ ctx . clientToProxyWebSocket . _socket . pause ( ) ;
628+
630629 var url ;
631630 if ( upgradeReq . url == '' || / ^ \/ / . test ( upgradeReq . url ) ) {
632631 var hostPort = Proxy . parseHostAndPort ( upgradeReq ) ;
@@ -661,8 +660,8 @@ Proxy.prototype._onWebSocketServerConnect = function(isSSL, ws, upgradeReq) {
661660 ctx . proxyToServerWebSocket . on ( 'error' , self . _onWebSocketError . bind ( self , ctx ) ) ;
662661 ctx . proxyToServerWebSocket . on ( 'close' , self . _onWebSocketClose . bind ( self , ctx , true ) ) ;
663662 ctx . proxyToServerWebSocket . on ( 'open' , function ( ) {
664- if ( ctx . clientToProxyWebSocket . readyState === WebSocket . OPEN && typeof ctx . clientToProxyWebSocket . resume === 'function' ) {
665- ctx . clientToProxyWebSocket . resume ( ) ;
663+ if ( ctx . clientToProxyWebSocket . readyState === WebSocket . OPEN ) {
664+ ctx . clientToProxyWebSocket . _socket . resume ( ) ;
666665 }
667666 } ) ;
668667 }
0 commit comments