This CDN client is intended to be run as a Linux service on a distributed set of computers. Its usage is to respond to GET requests of the following form: GET HTTP/1.1 Host: http://:
Upon receiving this GET request, the client will do the following: 1) Send a DNS query for the provided URL to the given DNS server/port 2) Get the DNS response 3) Issue a GET request for the resolved address 4) Send the requester an HTTP response which is exactly the same as the one returned by the server with one additional header flag: Time-Elapsed:
- python 3.7
We provide the code here so that the script named startup.sh
may be executed successfully on Google Cloud VMs. To make this work, simply follow Runninng startup scripts instructions, and paste the content of startup
into the box.
startup
will:
- call wget on
client
and thedriver_to_client_pb2.py
from this repo. - execute
./client
This will spin up a CDN client as defined in the project PDF.
IF YOU MAKE A CHANGE TO THIS CODE AND WANT IT ON ALL OF THE CLIENTS, YOU MUST
- push your changes
- RESET every client VM. This will automatically get the updated code up and running on every client VM at once