Skip to content

Simple implementations of HTTP/1 and HTTP/2 servers on NodeJS

License

Notifications You must be signed in to change notification settings

flancer64/habr_node_http_servers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

habr_node_http_servers

This repo contains 2 servers based on node libs http & http2 (./http1.mjs & ./http2.mjs). Both servers have common functionality placed in ./lib.mjs. Simple web app in ./pub/index.html allows uploading files to ./pub/ folder (one folder for both servers), get listing of uploaded files, remove selected files.

It demonstrates basic HTTP possibilities:

  • handing out static files (GET requests);
  • files uploading;
  • Server Sent Events (listing generation);
  • files removal (POST requests);

Clone this repo to your computer then start the servers:

$ node http1.mjs & 
$ node http2.mjs & 

These servers use nodejs functionality only. You don't need to install any external npm packages.

Go to web apps:

HTTP/2 server use self-signed certificate (NET::ERR_CERT_AUTHORITY_INVALID), so you need to allow unsafe.

About

Simple implementations of HTTP/1 and HTTP/2 servers on NodeJS

Resources

License

Stars

Watchers

Forks

Packages

No packages published