You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You have two options here (same as with net/http) use a handler for a specific path or use a proxy server which will transfer all incoming requests to the target url.
// [...]import"github.com/kataras/iris/core/host"// [...]// proxySrv := iris.New()u, err:=url.Parse("https://localhost:4444")
iferr!=nil {
t.Fatalf("%v while parsing url", err)
}
p:=host.ProxyHandler(u)
// [...]app.Get("/some/api", iris.FromStd(p))
// or start a new whole proxy server:gohost.NewProxy("myproxy:3232", u).ListenAndServe()
These derives from net/http the only thing that Iris does, is some improvements on the url parsing and able to skip tls if your target is a loopback address (when testing).
For more options and advanced features you can take a look at other libraries, anything compatible with net/http is OK to being used inside iris too, therefore you don't have limitations.
How can i make that my path (for example "localhost/some/api") will be processed by another go service?
The text was updated successfully, but these errors were encountered: