WithClient sets the global proxy client. This function should be called before Do and Forward.
(cli *fasthttp.Client)
| 131 | // WithClient sets the global proxy client. |
| 132 | // This function should be called before Do and Forward. |
| 133 | func WithClient(cli *fasthttp.Client) { |
| 134 | if cli == nil { |
| 135 | panic("proxy: WithClient requires a non-nil *fasthttp.Client") |
| 136 | } |
| 137 | |
| 138 | client.Store(cli) |
| 139 | } |
| 140 | |
| 141 | // Forward performs the given http request and fills the given http response. |
| 142 | // This method will return a fiber.Handler |