Replace NewProxy with NewRedirection #1302

Replace NewProxy with NewRedirection

Former-commit-id: 850b44b026725625ece8436cd3cb70d8214584cf
This commit is contained in:
Gerasimos (Makis) Maropoulos 2019-07-23 19:02:27 +03:00 committed by GitHub
commit f814cb930e

View File

@ -21,10 +21,9 @@ func main() {
// to start a new server listening at :80 and redirects
// to the secure address, then:
target, _ := url.Parse("https://127.0.1:443")
go host.NewProxy("127.0.0.1:80", target).ListenAndServe()
target, _ := url.Parse("https://127.0.0.1:443")
go host.NewRedirection("127.0.0.1:80", target, 301).ListenAndServe()
// start the server (HTTPS) on port 443, this is a blocking func
app.Run(iris.TLS("127.0.0.1:443", "mycert.cert", "mykey.key"))
}