fixed container routes not being loaded, added X-Forwarded-{Scheme,Proto,Host}, fixed containers with no mapping being served

This commit is contained in:
yusing
2024-09-30 18:04:47 +08:00
parent 48dd1397e8
commit 478311fe9e
8 changed files with 38 additions and 16 deletions

View File

@@ -5,6 +5,7 @@ import (
"strconv"
"strings"
"github.com/sirupsen/logrus"
. "github.com/yusing/go-proxy/internal/common"
D "github.com/yusing/go-proxy/internal/docker"
F "github.com/yusing/go-proxy/internal/utils/functional"
@@ -72,11 +73,11 @@ func (e *RawEntry) FillMissingFields() bool {
// try to fallback to first public port
if p, ok := F.FirstValueOf(e.PublicPortMapping); ok {
pp = fmt.Sprint(p.PublicPort)
}
// ignore only if it is NOT RUNNING
// because stopped containers
// will have empty port mapping got from docker
if e.Running {
} else if e.Running {
// ignore only if it is NOT RUNNING
// because stopped containers
// will have empty port mapping got from docker
logrus.Debugf("ignored port %s for %s", pp, e.ContainerName)
return false
}
}