Skip to content

Demonstration of the max listener exceeded problem with http2 and serve-static

Notifications You must be signed in to change notification settings

akc42/maxListenerTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Max Listeners Exceeded Test

The purpose of this repository is to demonstrate how using http2 with serve-static will reliably generate MaxListenersExceededWarning warnings with as simple a setup as possible.

Setup

In order to use http2 you must use an ssl certificte. The two files certificate.pem and key.pem are the certificates generated by me as a certificate authority for the dual domain names maxtest.dev and maxtest.local. You will need to set your local dns up so that one of those two names match the ip address of the machine you run the code on. Alternatively provide your own certificate files.

Once that is completed we need to set up the server npm modules

cd server
npm install

running the test

From the root directory of the project, start the server thus:

node server/server.js

Use your browser to navigate to https://maxtext.dev:8443

This should be enough to generate the warnings (once only). Stop the server with ^C and you can then repeat the tests at will.

About

Demonstration of the max listener exceeded problem with http2 and serve-static

Resources

Stars

Watchers

Forks

Packages

No packages published