Minimal CLI application using TCP sockets to send HTTP requests.
Concordia University
Computer Networking
Lab assignment 1
Winter 2022
This CLI application is built as a submission to the COMP445 course at Concordia University.
Here are the expected arguments and options this CLI application expects:
$ httpc (get|post) [-v] (-h "k:v")* [-d inline-data] [-f file] URL
Clone this repository and install its dependencies.
$ yarn install
To be able to run this locally, you need to have installed Node.js 14 or later.
You must build the executable first. Transpile the Typescript code into Javascript with:
$ yarn build
You can then run the CLI application locally using the Javascript executable file in the dist
folder. For example:
$ node dist/src/httpc.js get https://httpbin.org/get
First, build the docker image for the executable using the Dockerfile provided.
$ docker build -t httpc .
Next, run the docker image while passing specified CLI arguments. For example:
$ docker run httpc get https://httpbin.org/get
By executing the CLI application as presented above can yield leftover unused docker containers. You can prevent this by appending the --rm
option. For example:
$ docker run --rm httpc get https://httpbin.org/get
Modules in this assignment are also covered as units of code.
$ yarn test
You can check the coverage with
$ yarn test:cov