fixed upnp

This commit is contained in:
ACoolName 2024-05-25 14:33:54 +03:00
parent 1ee6bfc21a
commit 302835b83b

View File

@ -377,7 +377,7 @@ func (con Connection) StartServer(ctx *gin.Context) {
for containerPort, portBindings := range containerData.NetworkSettings.Ports { for containerPort, portBindings := range containerData.NetworkSettings.Ports {
for _, hostPort := range portBindings { for _, hostPort := range portBindings {
number, proto := hostPort.HostPort, containerPort.Proto() number, proto := hostPort.HostPort, containerPort.Proto()
UPNPCommand := fmt.Sprintf("%s|%s|%s|%s|%s\n", HostIP, number, "0.0.0.0", number, strings.ToUpper(proto)) UPNPCommand := fmt.Sprintf("%s|%s|%s|%s\n", HostIP, number, number, strings.ToUpper(proto))
_, err := fo.Write([]byte(UPNPCommand)) _, err := fo.Write([]byte(UPNPCommand))
if err != nil { if err != nil {
ctx.AbortWithError(500, err) ctx.AbortWithError(500, err)