File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -13,16 +13,16 @@ const options ={
1313
1414const connections = { } ;
1515
16- const server = https . createServer ( options , function ( req , res ) {
17- const interval = setInterval ( function ( ) {
16+ const server = https . createServer ( options , ( req , res ) => {
17+ const interval = setInterval ( ( ) => {
1818res . write ( 'data' ) ;
1919} , 1000 ) ;
2020interval . unref ( ) ;
2121} ) ;
2222
23- server . on ( 'connection' , function ( connection ) {
23+ server . on ( 'connection' , ( connection ) => {
2424const key = `${ connection . remoteAddress } :${ connection . remotePort } ` ;
25- connection . on ( 'close' , function ( ) {
25+ connection . on ( 'close' , ( ) => {
2626delete connections [ key ] ;
2727} ) ;
2828connections [ key ] = connection ;
@@ -37,16 +37,16 @@ function shutdown(){
3737}
3838}
3939
40- server . listen ( 0 , function ( ) {
40+ server . listen ( 0 , ( ) => {
4141const requestOptions = {
4242hostname : '127.0.0.1' ,
43- port : this . address ( ) . port ,
43+ port : server . address ( ) . port ,
4444path : '/' ,
4545method : 'GET' ,
4646rejectUnauthorized : false
4747} ;
4848
49- const req = https . request ( requestOptions , function ( res ) {
49+ const req = https . request ( requestOptions , ( res ) => {
5050res . on ( 'data' , ( ) => { } ) ;
5151setImmediate ( shutdown ) ;
5252} ) ;
You can’t perform that action at this time.
0 commit comments