Skip to content

Commit f0cbaec

Browse files
committed
Update httpsify.go
1 parent 9e7aa68 commit f0cbaec

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

httpsify.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ import (
1414

1515
// --------------
1616

17+
const VERSION = "httpsify/v1.0"
18+
1719
var (
1820
port *string = flag.String("port", "443", "the port that will serve the https requests")
1921
cert *string = flag.String("cert", "./cert.pem", "the cert.pem save-path")
2022
key *string = flag.String("key", "./key.pem", "the key.pem save-path")
2123
domains *string = flag.String("domains", "", "a comma separated list of your site(s) domain(s)")
2224
backend *string = flag.String("backend", "", "the backend http server that will serve the terminated requests")
25+
info *string = flag.String("info", "yes", "whether to send information about httpsify or not ^_^")
2326
)
2427

2528
// --------------
@@ -70,6 +73,7 @@ func main() {
7073
}
7174
}
7275
}
76+
req.Header.Set("Host", r.Host)
7377
req.Header.Set("X-Real-IP", ip)
7478
req.Header.Set("X-Forwarded-For", ip)
7579
req.Header.Set("X-Forwarded-Proto", "https")
@@ -90,6 +94,9 @@ func main() {
9094
}
9195
}
9296
}
97+
if *info == "yes" {
98+
w.Header().Set("Server", VERSION)
99+
}
93100
w.WriteHeader(res.StatusCode)
94101
io.Copy(w, res.Body)
95102
})))

0 commit comments

Comments
 (0)