2016-01-27 21:24:36 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
2016-02-18 18:24:48 +08:00
|
|
|
"github.com/fatedier/frp/models/server"
|
2016-02-18 16:56:55 +08:00
|
|
|
"github.com/fatedier/frp/utils/conn"
|
|
|
|
"github.com/fatedier/frp/utils/log"
|
2016-01-27 21:24:36 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2016-02-18 18:24:48 +08:00
|
|
|
err := server.LoadConf("./frps.ini")
|
2016-01-27 21:24:36 +08:00
|
|
|
if err != nil {
|
|
|
|
os.Exit(-1)
|
|
|
|
}
|
|
|
|
|
2016-02-18 18:24:48 +08:00
|
|
|
log.InitLog(server.LogWay, server.LogFile, server.LogLevel)
|
2016-01-27 21:24:36 +08:00
|
|
|
|
2016-02-18 18:24:48 +08:00
|
|
|
l, err := conn.Listen(server.BindAddr, server.BindPort)
|
2016-01-27 21:24:36 +08:00
|
|
|
if err != nil {
|
|
|
|
log.Error("Create listener error, %v", err)
|
|
|
|
os.Exit(-1)
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Info("Start frps success")
|
|
|
|
ProcessControlConn(l)
|
|
|
|
}
|