@@ -224,15 +224,13 @@ Sometimes you want to listen to an event on a proxy. For example, you may want t
224
224
var httpProxy = require (' http-proxy' );
225
225
226
226
var server = httpProxy .createServer (function (req , res , proxy ) {
227
+ var buffer = httpProxy .buffer (req);
227
228
228
- var buffer = httpProxy .buffer (req);
229
-
230
- proxy .proxyRequest (req, res, {
231
- host: ' 127.0.0.1' ,
232
- port: 9000 ,
233
- buffer: buffer
234
- });
235
-
229
+ proxy .proxyRequest (req, res, {
230
+ host: ' 127.0.0.1' ,
231
+ port: 9000 ,
232
+ buffer: buffer
233
+ });
236
234
});
237
235
238
236
server .proxy .on (' end' , function () {
@@ -307,11 +305,11 @@ var https = require('https'),
307
305
//
308
306
// generic function to load the credentials context from disk
309
307
//
310
- function getCredentialsContext (cer ){
308
+ function getCredentialsContext (cer ) {
311
309
return crypto .createCredentials ({
312
- key: fs .readFileSync (path .join (__dirname , ' certs' , cer + ' .key' )),
313
- cert: fs .readFileSync (path .join (__dirname , ' certs' , cer + ' .crt' ))
314
- }).context ;
310
+ key: fs .readFileSync (path .join (__dirname , ' certs' , cer + ' .key' )),
311
+ cert: fs .readFileSync (path .join (__dirname , ' certs' , cer + ' .crt' ))
312
+ }).context ;
315
313
}
316
314
317
315
//
0 commit comments