When I want to learn a new programming language, my typical method of doing this is to either take an existing small project and port it over to the new language, or come up with a small, yet practical problem to solve. I’m kinda like Johnny Five, in that I need input!
I’ve been playing with Go for a little bit, but nothing very serious. I’ve also been playing around with Docker and Kubernetes, so I decided to kill two birds with one stone by building an application in Go as well as learning how to package it up in a Docker container.
Introducing Where To Now. It’s designed to vary the webpage that might show up when a user inside a corporation hits “Home” on their default browser. The idea being that “Home” might be a different target depending on the time of day.
When workers fire up their laptops at home in the morning and open their browser, content managers could first send users to an internal COVID-19 status page (or perhaps something from the CDC or WHO). When the local stock markets open, users could be routed to websites that read out stock data. In the afternoon to promote wellness content managers would want the home page to be a “Get up and stretch” message.
All of this is possible to be done in a number of ways, but I wanted to make a simple traffic cop style HTTP Listener in Go that would forward (via a HTTP redirect 303 message) the browser to a desired target depending on the time of day. It’s extremely lightweight as this is not a proxy, just a redirect. With the Docker instance, you can run it from anywhere. Just configure the new default home page to this address, and it will do the hard work for you.
To illustrate, here’s a potential timeline of sites to redirect to:
- Overnight and to the morning hours (so when someone connects for work), display a COVID-19 Status page.
- When markets open, Marketwatch.
- 30 minutes after they open, go to the Corporate Intranet Homepage.
- At 11:30, go to a food delivery service for lunch ordering.
- At 2pm, a STAND UP AND STRETCH page.
- At 4pm, back to the Corporate Intranet Homepage.
- At 6pm, a reminder to shut down and finish for the day.
All in all, the project was completed over the weekend and gave me a good feel for Go and how to package applications in general as a container.
Possibly Related Posts:
- Improve Outbound Email with SPF, DKIM, and DMARC
- Brando’s Rules for Success
- So You Want to Gong-Fu?
- Updated Tea Journey post
- Blockchain Fun
*** This is a Security Bloggers Network syndicated blog from Branden R. Williams, Business Security Specialist authored by Branden Williams. Read the original post at: http://feedproxy.google.com/~r/BrandenWilliamsSecurityConvergenceBlog/~3/65wSES4unA8/