Completed rename to server.
This commit is contained in:
parent
b956a160c9
commit
fb5937dbe7
18
main.go
18
main.go
|
@ -14,7 +14,7 @@ import (
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
lumberjack "gopkg.in/natefinch/lumberjack.v2"
|
lumberjack "gopkg.in/natefinch/lumberjack.v2"
|
||||||
|
|
||||||
"git.daplie.com/Daplie/go-rvpn-server/rvpn/genericlistener"
|
"git.daplie.com/Daplie/go-rvpn-server/rvpn/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -31,7 +31,7 @@ var (
|
||||||
argServerAdminBinding string
|
argServerAdminBinding string
|
||||||
argServerExternalBinding string
|
argServerExternalBinding string
|
||||||
argDeadTime int
|
argDeadTime int
|
||||||
connectionTable *genericlistener.Table
|
connectionTable *server.Table
|
||||||
secretKey = "abc123"
|
secretKey = "abc123"
|
||||||
wssHostName = "localhost.daplie.me"
|
wssHostName = "localhost.daplie.me"
|
||||||
adminHostName = "rvpn.daplie.invalid"
|
adminHostName = "rvpn.daplie.invalid"
|
||||||
|
@ -71,7 +71,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// send the output io.Writing to the other packages
|
// send the output io.Writing to the other packages
|
||||||
genericlistener.InitLogging(logoutput)
|
server.InitLogging(logoutput)
|
||||||
|
|
||||||
loginfo = log.New(logoutput, "INFO: main: ", logFlags)
|
loginfo = log.New(logoutput, "INFO: main: ", logFlags)
|
||||||
logdebug = log.New(logoutput, "DEBUG: main:", logFlags)
|
logdebug = log.New(logoutput, "DEBUG: main:", logFlags)
|
||||||
|
@ -107,12 +107,12 @@ func main() {
|
||||||
ctx, cancelContext := context.WithCancel(context.Background())
|
ctx, cancelContext := context.WithCancel(context.Background())
|
||||||
defer cancelContext()
|
defer cancelContext()
|
||||||
|
|
||||||
serverStatus := genericlistener.NewStatus(ctx)
|
serverStatus := server.NewStatus(ctx)
|
||||||
serverStatus.AdminDomain = adminHostName
|
serverStatus.AdminDomain = adminHostName
|
||||||
serverStatus.WssDomain = wssHostName
|
serverStatus.WssDomain = wssHostName
|
||||||
serverStatus.Name = serverName
|
serverStatus.Name = serverName
|
||||||
serverStatus.StartTime = time.Now()
|
serverStatus.StartTime = time.Now()
|
||||||
serverStatus.DeadTime = genericlistener.NewStatusDeadTime(dwell, idle, cancelcheck)
|
serverStatus.DeadTime = server.NewStatusDeadTime(dwell, idle, cancelcheck)
|
||||||
serverStatus.LoadbalanceDefaultMethod = lbDefaultMethod
|
serverStatus.LoadbalanceDefaultMethod = lbDefaultMethod
|
||||||
|
|
||||||
// Setup for GenericListenServe.
|
// Setup for GenericListenServe.
|
||||||
|
@ -124,16 +124,16 @@ func main() {
|
||||||
// - if tls, establish, protocol peek buffer, else decrypted
|
// - if tls, establish, protocol peek buffer, else decrypted
|
||||||
// - match protocol
|
// - match protocol
|
||||||
|
|
||||||
connectionTracking := genericlistener.NewTracking()
|
connectionTracking := server.NewTracking()
|
||||||
serverStatus.ConnectionTracking = connectionTracking
|
serverStatus.ConnectionTracking = connectionTracking
|
||||||
go connectionTracking.Run(ctx)
|
go connectionTracking.Run(ctx)
|
||||||
|
|
||||||
connectionTable = genericlistener.NewTable(dwell, idle)
|
connectionTable = server.NewTable(dwell, idle)
|
||||||
serverStatus.ConnectionTable = connectionTable
|
serverStatus.ConnectionTable = connectionTable
|
||||||
go connectionTable.Run(ctx, lbDefaultMethod)
|
go connectionTable.Run(ctx, lbDefaultMethod)
|
||||||
|
|
||||||
genericListeners := genericlistener.NewGenerListeners(ctx, secretKey, certbundle, serverStatus)
|
genericListeners := server.NewGenerListeners(ctx, secretKey, certbundle, serverStatus)
|
||||||
serverStatus.GenericListeners = genericListeners
|
//serverStatus.GenericListeners = genericListeners
|
||||||
|
|
||||||
go genericListeners.Run(ctx, argGenericBinding)
|
go genericListeners.Run(ctx, argGenericBinding)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue