I can use an HTTP client running on a PC to control the lights at home. This example shows an HTTP client running on a home lighting control board has been configured to monitor a lighting control website running on an Internet web server to determine if lights should be on or off.
I browse to the same lighting control webpage being monitored by the lighting control board, enter my username and password, and now have the ability to change the webpage. The next time the control board checks this webpage it will see the change and control the lights appropriately.
Example: HTTP Client and Server in the Same Local Host
A network host is usually either a client or a server but it is possible for a host to be both. Let’s see an example of this.
My control board may also have an HTTP Server running concurrently with the client. This could be used to serve a simple setup and configuration web page which would allow me to change the website and log-in information the HTTP client uses to check for lighting control updates.
Example: Local Network HTTP Server
If you do have an HTTP server running on your embedded device, it could also be used to actually control the device.
This would allow you to eliminate the HTTP client application and Internet web server. At first this may appear to be the best solution, but looks can be deceiving.
This is probably the easiest solution if the HTTP client is running on the same local network as the lighting control board. Unfortunately, this is not very common.
The ability to control the lights, or anything else from a remote location over the internet is a more likely and useful scenario. Accessing a web server on a local network from the Internet can be done, but it’s not a trivial task. Deciding where to locate a web server must be carefully considered.