Skip to content

Rantoledo/http2_nodejs_client_server_example2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

http2_nodejs_client_server_example

Deployment instructions:

  1. clone files and put server and client on a different linux machines.

deploy server:

  1. create certificate and key using open ssl (name them 'certificate.pem' and 'key.pem').
  2. create directory 'cert' next to server.js, and place 'certificate.pem' and 'key.pem' in it.
  3. in server directory, init npm (npm init), and install 'yargs' (npm i yargs) and 'mime-types'.
  4. execute node server.js --port=<port-number> --maxMem=<number-of-megabytes-memory-for-the-session> to deploy the server.

client side:

  1. go to client directory, and execute npm init, then install 'yargs', 'lodash' and 'bluebird'.
  2. create directory 'cert' next to client.js and place 'certificate.pem' there.
  3. execute node client.js --serverIP=<ip> --port=<server-port> --srcFolder=<absolute-path-to-directory-with-files-server-side> --trgFolder=<relative-path-to-target-folder-client-side> --concurrency=<number> --servername=<your-server-name> --oneSession=<true/false> (true - if you want the client to use one session for all the files, false- client will initiate new one for each file) to download directory with files from server.

client arguments (all required):
serverIP: ip of the server you deployed.
port: port your server is listening on.
srcFolder: ABSOLUTE path for the directory you want to download. directory must be exists and contain regular files only (no subdirectories, symlinks etc).
trgFolder: relative path to target folder on client side. all files will be downloaded to that folder. folder must be exists.
concurrecncy: number of files that node handles.
servername: the server name as you created your key and certificate with.

About

client and server using http2 node js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published