Commit 62e34aa8 authored by wangmingming's avatar wangmingming

11

parent 297457af
...@@ -64,7 +64,7 @@ func (c *Client) Start() error { ...@@ -64,7 +64,7 @@ func (c *Client) Start() error {
if err != nil { if err != nil {
logrus.Error("请求失败 ", err.Error()) logrus.Error("请求失败 ", err.Error())
return nil return err
} }
c.Response = resp c.Response = resp
return nil return nil
......
...@@ -47,12 +47,13 @@ func Forward(c *gin.Context) { ...@@ -47,12 +47,13 @@ func Forward(c *gin.Context) {
res := gin.H{} res := gin.H{}
res["msg"] = "请求成功" res["msg"] = "请求成功"
res["status_code"] = client.GetStatusCode() res["status_code"] = client.GetStatusCode()
res["text"] = client.GetText()
res["proxy"] = forWard.Proxy res["proxy"] = forWard.Proxy
res["headers"] = client.GetResponseHeaders() res["headers"] = client.GetResponseHeaders()
res["cookies"] = client.GetSessionCookies() res["cookies"] = client.GetSessionCookies()
res["cost_time"] = time.Now().Sub(t1).Milliseconds() res["cost_time"] = time.Now().Sub(t1).Milliseconds()
res["url"] = client.GetRespUrl() 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()) logrus.Infof("转发 %s %s %d 耗时 %s", forWard.Url, forWard.Proxy, client.GetStatusCode(), time.Now().Sub(t1).String())
c.JSON(200, res) 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