change log method

This commit is contained in:
fatedier
2019-10-12 20:13:12 +08:00
parent 5dc8175fc8
commit 649f47c345
44 changed files with 670 additions and 688 deletions

View File

@@ -2,8 +2,7 @@
server_addr = 127.0.0.1
server_port = 10700
log_file = console
# debug, info, warn, error
log_level = debug
log_level = trace
token = 123456
admin_port = 10600
admin_user = abc

View File

@@ -2,8 +2,7 @@
bind_addr = 0.0.0.0
bind_port = 10700
vhost_http_port = 10804
log_file = console
log_level = debug
log_level = trace
token = 123456
allow_ports = 10000-20000,20002,30000-50000
subdomain_host = sub.com

View File

@@ -11,7 +11,7 @@ import (
)
type EchoServer struct {
l frpNet.Listener
l net.Listener
port int
repeatedNum int
@@ -30,7 +30,7 @@ func NewEchoServer(port int, repeatedNum int, specifyStr string) *EchoServer {
}
func (es *EchoServer) Start() error {
l, err := frpNet.ListenTcp("127.0.0.1", es.port)
l, err := net.Listen("tcp", fmt.Sprintf("127.0.0.1:%d", es.port))
if err != nil {
fmt.Printf("echo server listen error: %v\n", err)
return err

View File

@@ -14,7 +14,6 @@ import (
"time"
"github.com/fatedier/frp/client"
frpNet "github.com/fatedier/frp/utils/net"
)
func GetProxyStatus(statusAddr string, user string, passwd string, name string) (status *client.ProxyStatusResp, err error) {
@@ -98,7 +97,7 @@ func ReloadConf(reloadAddr string, user string, passwd string) error {
}
func SendTcpMsg(addr string, msg string) (res string, err error) {
c, err := frpNet.ConnectTcpServer(addr)
c, err := net.Dial("tcp", addr)
if err != nil {
err = fmt.Errorf("connect to tcp server error: %v", err)
return