PR challenge: Find all X-Served-By web-servers behind a load-balancer.
MIT License
This repository accompanies a blog post, please read it before continuing.
The challenge: Reveal all the web-server nodes hidden behind a load-balancer by checking for the X-Served-By
header.
You will find a few solutions in Node.js, Bash and Go. This is an open invitation for your contribution. Solve the problem the way that feels most natural to you, in whatever programming language you like then:
This is a chance to contribute to an open-source project without having to over-commit your time or worry about pushing a flashy feature to an established code-base.
For a practical tutorial and progressive set of labs from an official Docker Captain try my Hands-on Docker Tutorial
Update: You may find that running the code against RaspberryPI.org results in only two VMs being returned instead of the full set. I've also included a fake endpoint in the Github repo. You can test against this without going to the public Internet.
If you are using Docker then you can make use of a pre-built image directly from the Docker Hub xservedbyfinder-endpoint:
$ docker pull alexellis2/xservedbyfinder-endpoint
$ docker run -d -p 3000:3000 alexellis2/xservedbyfinder-endpoint
Without Docker:
$ cd fakeendpoint/
$ node app.js
Listening on port 3000
You will now have a close simulation of the RaspberryPI.org website on the day as mentioned in the blog post.
Passing or configuring the URL by environmental variable.
Adding a Dockerfile
You can extra kudos for adding a Dockerfile
. This means anyone who wants to run your example can do so with zero fuss. I'd also like to include them in a CI build at a later date.
Several Dockerfiles are already included, please look through the examples if you need an example.