mirror of
https://github.com/kataras/iris.git
synced 2026-03-05 16:05:58 +00:00
Add listen and proxy tests
Former-commit-id: 7c89556942af8e9c6966022323cb9746db446cfc
This commit is contained in:
4
addr.go
4
addr.go
@@ -288,12 +288,14 @@ func Proxy(proxyAddr string, redirectSchemeAndHost string) func() error {
|
||||
// override the handler and redirect all requests to this addr
|
||||
h := ProxyHandler(redirectSchemeAndHost)
|
||||
prx := New(OptionDisableBanner(true))
|
||||
prx.Adapt(DevLogger())
|
||||
|
||||
prx.Adapt(RouterBuilderPolicy(func(RouteRepository, ContextPool) http.Handler {
|
||||
return h
|
||||
}))
|
||||
|
||||
go prx.Listen(proxyAddr)
|
||||
time.Sleep(300 * time.Millisecond)
|
||||
time.Sleep(150 * time.Millisecond)
|
||||
|
||||
return func() error { return prx.Close() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user