Web Applications

Go has a powerful HTTP package in the standard library. The net/http package is documented at https://golang.org/pkg/net/http/ and contains the HTTP and HTTPS utilities. At first, I advise that you stay away from the community HTTP frameworks and stick to the Go standard library. The standard HTTP package includes functions for listening, routing, and templating. The built-in HTTP server is of production quality, and it binds directly to a port, eliminating the need for a separate httpd, such as Apache, IIS, or nginx. However, it is common to see nginx listening on the public port 80 and reverse proxying all requests to Go servers listening on local ports other than 80.

In this chapter, we cover the basics of running an HTTP ...

Get Security with Go 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.