add ip param

This commit is contained in:
YouROK
2025-01-24 18:42:02 +03:00
parent d335016f05
commit f2ffd092ff
4 changed files with 11 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ import (
"server/web"
)
func Start(port, sslport, sslCert, sslKey string, sslEnabled, roSets, searchWA bool) {
func Start(port, ip, sslport, sslCert, sslKey string, sslEnabled, roSets, searchWA bool) {
settings.InitSets(roSets, searchWA)
// https checks
if sslEnabled {
@@ -50,8 +50,9 @@ func Start(port, sslport, sslCert, sslKey string, sslEnabled, roSets, searchWA b
if port == "" {
port = "8090"
}
log.TLogln("Check web port", port)
l, err := net.Listen("tcp", ":"+port)
l, err := net.Listen("tcp", ip+":"+port)
if l != nil {
l.Close()
}
@@ -64,6 +65,7 @@ func Start(port, sslport, sslCert, sslKey string, sslEnabled, roSets, searchWA b
// set settings http and https ports. Start web server.
settings.Port = port
settings.SslPort = sslport
settings.IP = ip
web.Start()
}