What

In the past few stories you have learned about what handlers are and what their code looks like. In this story you are going to be formally introduced to the last 7 handlers in Gorouter.

How

  1. Read the summary for each handler.
  2. Where there is a ✨ make sure you take a look at the code.

The next seven handlers

11. w3c W3c is a type of tracing header. If you enable the router.tracing.enable_w3c bosh property, then this handler will attach w3c headers on the request.

12. ✨Protocol Check This handler checks to make sure that the request is a valid HTTP protocol.

13. ✨Lookup This handler looks up the host in the route table and gets the route pool. The route pool contains all backends (IPs and Ports) for that route. The handler sets the route pool on the RequestInfo struct.

14. Client Cert This handler handles the “X-Forwarded-Client-Cert” and either passes it on to the app or not based on configuration.

15. XForwarded Proto This handler handles the “X-Forwarded-Proto” header based on configuration.

16. Route Service This handler handles requests for route services and request that are coming from a route service. (Route services are explained in another section).

17. ✨ Proxy This handler handles web socket requests

18. That’s it! Next comes the routing decisions with the Proxy Round Tripper! That’s in the next story.

Questions

❓If someone tries to send HTTP/2 traffic and the router.enable_http2 property is not set, where will it fail?