@@ -14,12 +14,15 @@ import (
1414
1515// --------------
1616
17+ const VERSION = "httpsify/v1.0"
18+
1719var (
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