v0.1.0
Add Response struct, fix name
go get github.com/bddjr/[email protected]
srv.Hlfhr_HttpOnHttpsPortErrorHandler = func(rb []byte, conn net.Conn) {
resp := hlfhr.NewResponse(conn)
// 302 Found
if host, path, ok := hlfhr.ReadReqHostPath(rb); ok {
resp.Redirect(302, fmt.Sprint("https://", host, path))
return
}
// script
resp.ScriptRedirect()
}