File tree 2 files changed +39
-2
lines changed
2 files changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ function ForwardStream() {
25
25
26
26
Writable . call ( this ) ;
27
27
28
- this . once ( 'pipe' , function ( ) { self . onPipe ( ) } ) ;
28
+ this . once ( 'pipe' , function ( pipe ) { self . onPipe ( pipe ) } ) ;
29
29
this . once ( 'finish' , function ( ) { self . onFinish ( ) } ) ;
30
30
}
31
31
Original file line number Diff line number Diff line change
1
+ var Duplex = require ( 'stream' ) . Duplex ,
2
+ common = require ( '../common' ) ,
3
+ http = require ( 'http' ) ,
4
+ https = require ( 'https' ) ;
5
+
1
6
function ProxyStream ( ) {
7
+ var self = this ;
8
+
9
+ Duplex . call ( this ) ;
10
+
11
+ this . once ( 'pipe' , function ( pipe ) { self . onPipe ( pipe ) ; } ) ;
12
+ this . once ( 'finish' , function ( ) { self . onFinish ( ) ; } ) ;
13
+ }
14
+
15
+ ProxyStream . prototype . onPipe = function ( request ) {
16
+ var self = this ;
17
+
18
+ this . proxyReq = ( options . ssl ? https : http ) . request (
19
+ common . setupOutgoing ( options . ssl || { } , options , request )
20
+ ) ;
21
+
22
+ this . proxyReq . once ( 'response' , function ( response ) {
23
+ self . onResponse ( response ) ;
24
+ } )
25
+ this . proxyReq . on ( 'error' , function ( ) { } ) ; // XXX TODO: add error handling
26
+ }
27
+
28
+ ProxyStream . prototype . onFinish = function ( ) {
2
29
3
- }
30
+ }
31
+
32
+ ProxyStream . prototype . onResponse = function ( ) {
33
+
34
+ }
35
+
36
+ ProxyStream . prototype . _read = function ( ) { }
37
+
38
+ ProxyStream . prototype . _write = function ( ) { }
39
+
40
+ require ( 'util' ) . inherits ( ForwardStream , Duplex ) ;
You can’t perform that action at this time.
0 commit comments