Setting up a local HTTP server

In our next example, we will be downloading a file over HTTP. If you don't have a local HTTP server, you can just use any publicly available HTTP or HTTPS resource to test your code. However, when you develop and test a network-enabled application, it is recommended that you use a private, local network if feasible. This way, it is possible to debug both ends of the connection, and errors will not expose sensitive data.

If you are not familiar with setting up a web server locally on your machine, there are, luckily, a number of all-in-one installers that are freely available. These will automatically configure Apache2, MySQL (or MariaDB), PHP, and many other servers on your system. On Windows, for example, you ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.