Updated Writing a Plugin: Server Type (markdown)

Matt Holt 2016-08-20 08:53:32 -06:00
parent b129f5b866
commit ed32fb301d

@ -4,6 +4,8 @@ Caddy ships with an HTTP server, but you can implement other server types and pl
_To Caddy, the notion of a server is anything that can `Listen()` and `Serve()`. What that means and how that works is up to you. Feel free to be creative and liberal with this idea._
If your server type can use TLS, it should take advantage of Caddy's magic TLS features. We describe how to do that at the end of this guide.
At a high level, plugging in a server type is very easy, using the [caddy.RegisterServerType()](https://godoc.org/github.com/mholt/caddy#RegisterServerType) function. You pass in the name of the server type and a [caddy.ServerType](https://godoc.org/github.com/mholt/caddy#ServerType) struct describing it.
Here's a (somewhat simplified) example of how the HTTP server does it: