npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

http2-debug

v1.2.1

Published

A simple toolkit to debug http2 client requests

Downloads

21

Readme

HTTP2 debug

Greenkeeper badge

NPM Version Build Status

Debug http2 client requests

Purpose

http2-debug will help you to understand if your are making http2 request from your service. It acts as an http2 echo server. It returns in the response body the following information:

  • Hostname (Whoami)
  • HTTP2 headers
  • HTTP2 body

With this information you will be able to see if the desired information was sent from your service.

It's also very helpful for HTTP2 load balancer testing. You can use it to test kubernetes ingress / docker LB + http2.

Local usage

Before testing please make sure your version of nodejs is support http2. To check your node version run on your terminal / CMD the fllowing command:

node -v 

Http2 was added to Node.js only on later versions of >v8.5 . If you need to upgrade or install Node.js got to: Download page of Node.js

Install this module

npm i http2-debug -g

Run the following command from any folder

http2-debug 

That's it you now have an HTTP2 server running with selfsigned certificate. Don't forget to enable security notice. By default server is lisening to 0.0.0.0:8443 .

Advanced usage

For custom http response you can overide the default onStream method. Overide could be done by either inheritance from the debug server or by regular assignment.

    class CustomHttpDebugServer extends Http2Debug{
      onStream(stream , headers){
        stream.respond({
                'content-type': 'text/html',
                ':status': 200
        });
        stream.end('hi');
      }
    }
    const http2Debug = new CustomHttpDebugServer;
    http2Debug.createServer((err)=>{
        //...//
    });

HTTP2 certificates

To enable fast debuging, this module comes with a self signed certificate. To use it you must disable security warnings. In Node.jd request client just set the following options rejectUnauthorized to false.

Detailed decription could be found here: Node.js TLS API

API

The comes with some default you can overide these as you see fit

  • --host=0.0.0.0
  • --port=8443
  • --key=THE_PATH_TO_THE_KEY_FILE
  • --cert=THE_PATH_TO_THE_CERT_FILE

For example to change all configuration , run in terminal / CMD:

http2-debug --host=10.10.90.210 --port=443 --key=./my-key.pem  --cert=./my-cert.pem

Run with Docker

docker run -p 8443:8443 hisco/http2-debug

Registry link Link to hub registry

License

MIT