@@ -57,12 +57,12 @@ const proxy = net.createServer((clientSocket) => {
57
57
clientSocket . on ( 'data' , ( chunk ) => {
58
58
if ( ! serverSocket ) {
59
59
// Verify the CONNECT request
60
- assert . strictEqual ( `CONNECT localhost:${ server . address ( ) . port } ` +
60
+ assert . strictEqual ( chunk . toString ( ) ,
61
+ `CONNECT localhost:${ server . address ( ) . port } ` +
61
62
'HTTP/1.1\r\n' +
62
63
'Proxy-Connections: keep-alive\r\n' +
63
64
`Host: localhost:${ proxy . address ( ) . port } \r\n` +
64
- 'Connection: close\r\n\r\n' ,
65
- chunk . toString ( ) ) ;
65
+ 'Connection: close\r\n\r\n' ) ;
66
66
67
67
console . log ( 'PROXY: got CONNECT request' ) ;
68
68
console . log ( 'PROXY: creating a tunnel' ) ;
@@ -126,7 +126,7 @@ proxy.listen(0, common.mustCall(() => {
126
126
}
127
127
128
128
function onConnect ( res , socket , header ) {
129
- assert . strictEqual ( 200 , res . statusCode ) ;
129
+ assert . strictEqual ( res . statusCode , 200 ) ;
130
130
console . log ( 'CLIENT: got CONNECT response' ) ;
131
131
132
132
// detach the socket
@@ -149,10 +149,10 @@ proxy.listen(0, common.mustCall(() => {
149
149
agent : false ,
150
150
rejectUnauthorized : false
151
151
} , ( res ) => {
152
- assert . strictEqual ( 200 , res . statusCode ) ;
152
+ assert . strictEqual ( res . statusCode , 200 ) ;
153
153
154
154
res . on ( 'data' , common . mustCall ( ( chunk ) => {
155
- assert . strictEqual ( 'hello world\n' , chunk . toString ( ) ) ;
155
+ assert . strictEqual ( chunk . toString ( ) , 'hello world\n' ) ;
156
156
console . log ( 'CLIENT: got HTTPS response' ) ;
157
157
gotRequest = true ;
158
158
} ) ) ;
0 commit comments