mirror of
https://github.com/caddyserver/caddy.git
synced 2025-07-09 03:04:57 -04:00
Updated Writing a Plugin: Server Type (markdown)
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user