add new argument for remote port

This commit is contained in:
Adrian Zuercher
2025-07-11 17:46:32 +02:00
parent e75d7c8b03
commit be07dc8749
3 changed files with 8 additions and 5 deletions

View File

@@ -43,6 +43,7 @@ func Init() *Args {
keyFile := flag.String("keyFile", "./cert/key.pem", "path of keyfile") keyFile := flag.String("keyFile", "./cert/key.pem", "path of keyfile")
portHttp := flag.Uint("http-port", 8100, "json server communication for http/ws") portHttp := flag.Uint("http-port", 8100, "json server communication for http/ws")
portHttps := flag.Uint("https-port", 8101, "json server communication for http/wss") portHttps := flag.Uint("https-port", 8101, "json server communication for http/wss")
remotePort := flag.Uint("remotePort", 9500, "remote Port of gui user interface")
rootDir := flag.String("workingDir", "./", "working directory") rootDir := flag.String("workingDir", "./", "working directory")
dbmFile := flag.String("dbm", "/test/test", "dbm file name") dbmFile := flag.String("dbm", "/test/test", "dbm file name")
debug := flag.Bool("debug", false, "debug flag") debug := flag.Bool("debug", false, "debug flag")
@@ -56,8 +57,9 @@ func Init() *Args {
KeyFile: *keyFile, KeyFile: *keyFile,
}, },
Port: models.Port{ Port: models.Port{
Http: *portHttp, Http: *portHttp,
Https: *portHttps, Https: *portHttps,
Remote: *remotePort,
}, },
RootDir: *rootDir, RootDir: *rootDir,
DBMFile: *dbmFile, DBMFile: *dbmFile,

View File

@@ -23,7 +23,7 @@ func main() {
//initialize new server //initialize new server
dbmHandler.Log.Debug("main", "initialize new server instance") dbmHandler.Log.Debug("main", "initialize new server instance")
s := ws.NewServer(a.AllowOrigins, 9000) s := ws.NewServer(a.AllowOrigins, a.Port.Remote)
//set routes //set routes
dbmHandler.Log.Debug("main", "setting routes") dbmHandler.Log.Debug("main", "setting routes")

View File

@@ -1,6 +1,7 @@
package models package models
type Port struct { type Port struct {
Http uint Http uint
Https uint Https uint
Remote uint
} }