From 78e5e6d626e59662377c288724915790489c50a3 Mon Sep 17 00:00:00 2001 From: roamboy <0yfj0@163.com> Date: Tue, 16 Jul 2019 13:37:53 +0800 Subject: [PATCH 1/2] NewProxy no work NewProxy no work Former-commit-id: 01923793abb91d5c9ce661136f5f02e1ba0a3b2c --- _examples/http-listening/listen-tls/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_examples/http-listening/listen-tls/main.go b/_examples/http-listening/listen-tls/main.go index 04b57de6..a6bfdbe5 100644 --- a/_examples/http-listening/listen-tls/main.go +++ b/_examples/http-listening/listen-tls/main.go @@ -22,7 +22,7 @@ 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() + 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")) From ba2919b4c205f517df617f2a8cdd8aedf9eac57f Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Tue, 23 Jul 2019 18:12:18 +0300 Subject: [PATCH 2/2] fixes Former-commit-id: d12fa8ee9af63187a2f143f27b08cbdb80609e2a --- _examples/http-listening/listen-tls/main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/_examples/http-listening/listen-tls/main.go b/_examples/http-listening/listen-tls/main.go index a6bfdbe5..cb0d6dfa 100644 --- a/_examples/http-listening/listen-tls/main.go +++ b/_examples/http-listening/listen-tls/main.go @@ -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.NewRedirection("127.0.0.1:80", target, 301).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")) - }