Browse Source

fix:端口范围映射bug

刘河 5 years ago
parent
commit
3cc4234117
2 changed files with 4 additions and 1 deletions
  1. 1 0
      bridge/bridge.go
  2. 3 1
      lib/config/config.go

+ 1 - 0
bridge/bridge.go

@@ -473,6 +473,7 @@ loop:
 						tl.Remark = t.Remark
 					} else {
 						tl.Remark = t.Remark + "_" + strconv.Itoa(tl.Port)
+						tl.Target = new(file.Target)
 						if t.TargetAddr != "" {
 							tl.Target.TargetStr = t.TargetAddr + ":" + strconv.Itoa(targets[i])
 						} else {

+ 3 - 1
lib/config/config.go

@@ -227,8 +227,10 @@ func dealTunnel(s string) *file.Tunnel {
 			t.ServerIp = item[1]
 		case "mode":
 			t.Mode = item[1]
-		case "target_port", "target_addr":
+		case "target_addr":
 			t.Target.TargetStr = strings.Replace(item[1], ",", "\n", -1)
+		case "target_port":
+			t.Target.TargetStr = item[1]
 		case "target_ip":
 			t.TargetAddr = item[1]
 		case "password":