mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-23 11:00:00 +08:00
Initial commit
This commit is contained in:
27
modules/caddyhttp/caddyhttp.go
Normal file
27
modules/caddyhttp/caddyhttp.go
Normal file
@ -0,0 +1,27 @@
|
||||
package caddyhttp
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"bitbucket.org/lightcodelabs/caddy2"
|
||||
)
|
||||
|
||||
func init() {
|
||||
err := caddy2.RegisterModule(caddy2.Module{
|
||||
Name: "http",
|
||||
New: func() (interface{}, error) { return httpModuleConfig{}, nil },
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
type httpModuleConfig struct {
|
||||
Servers map[string]httpServerConfig `json:"servers"`
|
||||
}
|
||||
|
||||
type httpServerConfig struct {
|
||||
Listen []string `json:"listen"`
|
||||
ReadTimeout string `json:"read_timeout"`
|
||||
ReadHeaderTimeout string `json:"read_header_timeout"`
|
||||
}
|
Reference in New Issue
Block a user