Deployment instructions:
- clone files and put server and client on a different linux machines.
- create certificate and key using open ssl (name them 'certificate.pem' and 'key.pem').
- create directory 'cert' next to server.js, and place 'certificate.pem' and 'key.pem' in it.
- in server directory, init npm (
npm init
), and install 'yargs' (npm i yargs
) and 'mime-types'. - execute
node server.js --port=<port-number> --maxMem=<number-of-megabytes-memory-for-the-session>
to deploy the server.
- go to client directory, and execute
npm init
, then install 'yargs', 'lodash' and 'bluebird'. - create directory 'cert' next to client.js and place 'certificate.pem' there.
- 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.