From be07dc8749c308d8482e1a27d5d4a965ca392748 Mon Sep 17 00:00:00 2001 From: Adrian Zuercher Date: Fri, 11 Jul 2025 17:46:32 +0200 Subject: [PATCH] add new argument for remote port --- args/args.go | 6 ++++-- main.go | 2 +- models/port.go | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/args/args.go b/args/args.go index 0f4e1a2..20cf89e 100644 --- a/args/args.go +++ b/args/args.go @@ -43,6 +43,7 @@ func Init() *Args { keyFile := flag.String("keyFile", "./cert/key.pem", "path of keyfile") portHttp := flag.Uint("http-port", 8100, "json server communication for http/ws") 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") dbmFile := flag.String("dbm", "/test/test", "dbm file name") debug := flag.Bool("debug", false, "debug flag") @@ -56,8 +57,9 @@ func Init() *Args { KeyFile: *keyFile, }, Port: models.Port{ - Http: *portHttp, - Https: *portHttps, + Http: *portHttp, + Https: *portHttps, + Remote: *remotePort, }, RootDir: *rootDir, DBMFile: *dbmFile, diff --git a/main.go b/main.go index 894b31d..5fc76e8 100644 --- a/main.go +++ b/main.go @@ -23,7 +23,7 @@ func main() { //initialize new server dbmHandler.Log.Debug("main", "initialize new server instance") - s := ws.NewServer(a.AllowOrigins, 9000) + s := ws.NewServer(a.AllowOrigins, a.Port.Remote) //set routes dbmHandler.Log.Debug("main", "setting routes") diff --git a/models/port.go b/models/port.go index 5394e13..8fc96a1 100644 --- a/models/port.go +++ b/models/port.go @@ -1,6 +1,7 @@ package models type Port struct { - Http uint - Https uint + Http uint + Https uint + Remote uint }