Web servers

The examples in the course are designed to work with specific origins. Students should set up two local web servers handling requests to different origins. For simplicity, we recommend that the web servers run locally. The next picture describes the origins students should install.

In the picture, the local IP address hosts two servers (one at port 8080 and other at port 9090). We describe how to install the servers in Windows by using Mongoose, a very simple and easy to use web server. Although the instructions are for Windows, Mongoose is cross-platform and works in Apple OS X and Linux. In this light, the installation steps should be similar.



We need to map alice.com and bob.com to the local host. For that, you can download the free program HostMan, which edits the host file in Windows. You should map your local IP to alice.com and bob.com as shown in the picture (remember that your local private IP address might use a different format)

Test run

Similarly, if you execute mongoose-free-5.6 in the folder Website B, your should see the greeting from Bob.

You are done!