From 898d4e705e35bff57312a3bcc94dca4581bd0433 Mon Sep 17 00:00:00 2001 From: Jrohy Date: Wed, 29 Mar 2023 17:58:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/controller/trojan.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/controller/trojan.go b/web/controller/trojan.go index 382d92c0..b5cfb74e 100644 --- a/web/controller/trojan.go +++ b/web/controller/trojan.go @@ -13,7 +13,7 @@ import ( "time" "trojan/core" "trojan/trojan" - websocket "trojan/util" + "trojan/util" ) // Start 启动trojan @@ -71,16 +71,16 @@ func GetLogLevel() *ResponseBody { // Log 通过ws查看trojan实时日志 func Log(c *gin.Context) { var ( - wsConn *websocket.WsConnection + wsConn *util.WsConnection err error ) - if wsConn, err = websocket.InitWebsocket(c.Writer, c.Request); err != nil { + if wsConn, err = util.InitWebsocket(c.Writer, c.Request); err != nil { fmt.Println(err) return } defer wsConn.WsClose() param := c.DefaultQuery("line", "300") - if !websocket.IsInteger(param) { + if !util.IsInteger(param) { fmt.Println("invalid param: " + param) return } @@ -89,7 +89,7 @@ func Log(c *gin.Context) { } else { param = "-n " + param } - result, err := websocket.LogChan("trojan", param, wsConn.CloseChan) + result, err := util.LogChan("trojan", param, wsConn.CloseChan) if err != nil { fmt.Println(err) return