added log

This commit is contained in:
ACoolName 2024-05-25 14:30:25 +03:00
parent a5ef148134
commit 1ee6bfc21a

View File

@ -377,11 +377,13 @@ func (con Connection) StartServer(ctx *gin.Context) {
for containerPort, portBindings := range containerData.NetworkSettings.Ports {
for _, hostPort := range portBindings {
number, proto := hostPort.HostPort, containerPort.Proto()
_, err := fo.Write([]byte(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|%s\n", HostIP, number, "0.0.0.0", number, strings.ToUpper(proto))
_, err := fo.Write([]byte(UPNPCommand))
if err != nil {
ctx.AbortWithError(500, err)
return
}
log.Printf("Wrote command \"%s\" to %s", UPNPCommand, UPNPPath)
}
}
}