Commit 62e34aa8 authored by wangmingming's avatar wangmingming

11

parent 297457af
......@@ -64,7 +64,7 @@ func (c *Client) Start() error {
if err != nil {
logrus.Error("请求失败 ", err.Error())
return nil
return err
}
c.Response = resp
return nil
......
......@@ -47,12 +47,13 @@ func Forward(c *gin.Context) {
res := gin.H{}
res["msg"] = "请求成功"
res["status_code"] = client.GetStatusCode()
res["text"] = client.GetText()
res["proxy"] = forWard.Proxy
res["headers"] = client.GetResponseHeaders()
res["cookies"] = client.GetSessionCookies()
res["cost_time"] = time.Now().Sub(t1).Milliseconds()
res["url"] = client.GetRespUrl()
res["text"] = client.GetText()
logrus.Infof("转发 %s %s %d 耗时 %s", forWard.Url, forWard.Proxy, client.GetStatusCode(), time.Now().Sub(t1).String())
c.JSON(200, res)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment