Skip to content

boris-chernysh/nel-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Network error logging example

Prerequisite

Network Error Logging is a mechanism that allows to receive reports about network requests from browser page.

Https needed for NEL work, thats why testing this technology gets little bit complicated. This repository is ready-to-deploy test environment for NEL that can be used on localhost and supports https and multidomain.

How to run

  1. Install mkcert;
  2. Run mkcert -install it will request password for install root-CA;
  3. Execute script for create certificates ./createCert.sh;
  4. Run sudo ./setHosts.sh it will add domains to /etc/hosts (thats why it requires sudo);
  5. Deploy docker-compose up.

How to test

  1. Navigate to https://www.mydomain.local/ in your browser, the response should be hello
  2. Wait a little while your browser determines the moment to send a request to collector
  3. You will see a POST request to: www.mydomain.local /report-collector/ text in your logs
  4. You can manually request collected reports via GET https://www.mydomain.local/report-collector/getRequests

Cleaning up

  1. After you are done with testing remove any occurencies of mydomain in your hosts
  2. Optionally remove docker image using
docker rmi nel-example_reportcollector -f

About

Example of using Network Error Logging

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors