系统变量新增proxy相关字段

This commit is contained in:
Liujian
2023-12-26 08:59:57 +08:00
parent 7bfd544e28
commit d9067a54a5
7 changed files with 75 additions and 16 deletions

View File

@@ -149,7 +149,11 @@ func (ctx *HttpContext) SendTo(scheme string, node eoscContext.INode, timeout ti
}
beginTime := time.Now()
ctx.response.responseError = fasthttp_client.ProxyTimeout(scheme, rewriteHost, node, request, &ctx.fastHttpRequestCtx.Response, timeout)
agent := newRequestAgent(&ctx.proxyRequest, host, scheme, beginTime, time.Now())
var responseHeader *fasthttp.ResponseHeader
if ctx.response.Response != nil {
responseHeader = &ctx.response.Response.Header
}
agent := newRequestAgent(&ctx.proxyRequest, host, scheme, responseHeader, beginTime, time.Now())
if ctx.response.responseError != nil {
agent.setStatusCode(504)
} else {