Commit 4771cd35 authored by wangmingming's avatar wangmingming

11

parent e8398a84
...@@ -3,8 +3,8 @@ package main ...@@ -3,8 +3,8 @@ package main
import ( import (
nested "github.com/antonfisher/nested-logrus-formatter" nested "github.com/antonfisher/nested-logrus-formatter"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/natefinch/lumberjack"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"gopkg.in/natefinch/lumberjack.v2"
"time" "time"
"tls-forward/tls" "tls-forward/tls"
) )
...@@ -44,7 +44,8 @@ func main() { ...@@ -44,7 +44,8 @@ func main() {
Compress: true, // disabled by default Compress: true, // disabled by default
} }
logrus.SetOutput(logWriter) logrus.SetOutput(logWriter)
//logrus.SetOutput(io.MultiWriter(logWriter, os.Stdout))
//logrus.SetOutput(os.Stdout)
r := gin.New() //创建一个默认的路由引擎 r := gin.New() //创建一个默认的路由引擎
r.Use(LoggerMiddleware()) r.Use(LoggerMiddleware())
r.POST("/tls/forward", tls.Forward) r.POST("/tls/forward", tls.Forward)
......
...@@ -26,6 +26,7 @@ func Forward(c *gin.Context) { ...@@ -26,6 +26,7 @@ func Forward(c *gin.Context) {
}) })
return return
} }
logrus.Infof("开始转发 url: %s proxy: %s", forWard.Url, forWard.Proxy)
t1 := time.Now() t1 := time.Now()
// 开始转发 // 开始转发
client, err := NewClient(forWard) client, err := NewClient(forWard)
......
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