serve wildcard certificate files
This commit is contained in:
parent
18932d3873
commit
c639bddaeb
15
http/server.go
Normal file
15
http/server.go
Normal file
@ -0,0 +1,15 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func ServeCertificate() {
|
||||
http.HandleFunc("/server.key", func(w http.ResponseWriter, r *http.Request) {
|
||||
http.ServeFile(w, r, "/certs/server.key")
|
||||
})
|
||||
http.HandleFunc("/server.pem", func(w http.ResponseWriter, r *http.Request) {
|
||||
http.ServeFile(w, r, "/certs/server.pem")
|
||||
})
|
||||
http.ListenAndServe(":9229", nil)
|
||||
}
|
5
main.go
5
main.go
@ -6,6 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"local-ip.sh/certs"
|
||||
"local-ip.sh/http"
|
||||
"local-ip.sh/xip"
|
||||
)
|
||||
|
||||
@ -15,7 +16,7 @@ const (
|
||||
)
|
||||
|
||||
func main() {
|
||||
var port = flag.Int("port", 53, "port the DNS server should bind to")
|
||||
port := flag.Int("port", 53, "port the DNS server should bind to")
|
||||
flag.Parse()
|
||||
|
||||
n := xip.NewXip(zone, strings.Split(nameservers, ","), *port)
|
||||
@ -34,5 +35,7 @@ func main() {
|
||||
}
|
||||
}()
|
||||
|
||||
go http.ServeCertificate()
|
||||
|
||||
n.StartServer()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user