mirror of
https://github.com/fatedier/frp.git
synced 2025-07-26 23:29:58 +00:00
Use go fmt before build
This commit is contained in:
@@ -11,16 +11,15 @@ import (
|
||||
|
||||
// common config
|
||||
var (
|
||||
BindAddr string = "0.0.0.0"
|
||||
BindPort int64 = 9527
|
||||
LogFile string = "./frps.log"
|
||||
LogLevel string = "warn"
|
||||
LogWay string = "file"
|
||||
BindAddr string = "0.0.0.0"
|
||||
BindPort int64 = 9527
|
||||
LogFile string = "./frps.log"
|
||||
LogLevel string = "warn"
|
||||
LogWay string = "file"
|
||||
)
|
||||
|
||||
var ProxyServers map[string]*models.ProxyServer = make(map[string]*models.ProxyServer)
|
||||
|
||||
|
||||
func LoadConf(confFile string) (err error) {
|
||||
var tmpStr string
|
||||
var ok bool
|
||||
|
@@ -1,12 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/fatedier/frp/pkg/utils/log"
|
||||
"github.com/fatedier/frp/pkg/utils/conn"
|
||||
"github.com/fatedier/frp/pkg/models"
|
||||
"github.com/fatedier/frp/pkg/utils/conn"
|
||||
"github.com/fatedier/frp/pkg/utils/log"
|
||||
)
|
||||
|
||||
func ProcessControlConn(l *conn.Listener) {
|
||||
@@ -41,7 +41,7 @@ func controlWorker(c *conn.Conn) {
|
||||
clientCtlRes.Code = 1
|
||||
clientCtlRes.Msg = msg
|
||||
}
|
||||
|
||||
|
||||
if needRes {
|
||||
buf, _ := json.Marshal(clientCtlRes)
|
||||
err = c.Write(string(buf) + "\n")
|
||||
@@ -49,7 +49,7 @@ func controlWorker(c *conn.Conn) {
|
||||
log.Warn("Write error, %v", err)
|
||||
}
|
||||
} else {
|
||||
// work conn, just return
|
||||
// work conn, just return
|
||||
return
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ func checkProxy(req *models.ClientCtlReq, c *conn.Conn) (succ bool, msg string,
|
||||
log.Warn(msg)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// control conn
|
||||
if req.Type == models.ControlConn {
|
||||
if server.Status != models.Idle {
|
||||
@@ -115,7 +115,7 @@ func checkProxy(req *models.ClientCtlReq, c *conn.Conn) (succ bool, msg string,
|
||||
|
||||
log.Info("ProxyName [%s], start proxy success", req.ProxyName)
|
||||
} else if req.Type == models.WorkConn {
|
||||
// work conn
|
||||
// work conn
|
||||
needRes = false
|
||||
if server.Status != models.Working {
|
||||
log.Warn("ProxyName [%s], is not working when it gets one new work conn", req.ProxyName)
|
||||
|
@@ -3,8 +3,8 @@ package main
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/fatedier/frp/pkg/utils/log"
|
||||
"github.com/fatedier/frp/pkg/utils/conn"
|
||||
"github.com/fatedier/frp/pkg/utils/log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
Reference in New Issue
Block a user