Skip to content

Commit bdc481e

Browse files
committed
fix: template create tunnel, client add mode param.
1 parent f7b6018 commit bdc481e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

internal/api/tunnel.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ func (h *TunnelHandler) HandleTemplateCreate(c *gin.Context) {
12831283
listenAddr = fmt.Sprintf(":%d", req.ListenPort)
12841284
}
12851285

1286-
tunnelURL := fmt.Sprintf("client://%s/%s:%d?log=%s",
1286+
tunnelURL := fmt.Sprintf("client://%s/%s:%d?log=%s&mode=1",
12871287
listenAddr,
12881288
req.Inbounds.TargetHost,
12891289
req.Inbounds.TargetPort,
@@ -1341,12 +1341,6 @@ func (h *TunnelHandler) HandleTemplateCreate(c *gin.Context) {
13411341
}
13421342
}
13431343
}
1344-
// if err == nil {
1345-
// groupName := endpointName
1346-
// if err := h.createTunnelGroup(groupName, "single", "单端转发分组", []int64{tunnelID}); err != nil {
1347-
// log.Warnf("[API] 自动创建分组失败: %v", err)
1348-
// }
1349-
// }
13501344

13511345
c.JSON(http.StatusOK, tunnel.TunnelResponse{
13521346
Success: true,
@@ -1461,7 +1455,7 @@ func (h *TunnelHandler) HandleTemplateCreate(c *gin.Context) {
14611455
}
14621456

14631457
// 双端转发:client端连接到server的IP:listen_port,转发到inbounds的target
1464-
clientURL := fmt.Sprintf("client://%s:%d/%s:%d?log=%s",
1458+
clientURL := fmt.Sprintf("client://%s:%d/%s:%d?log=%s&mode=2",
14651459
serverIP,
14661460
req.ListenPort,
14671461
clientConfig.TargetHost,
@@ -1682,7 +1676,7 @@ func (h *TunnelHandler) HandleTemplateCreate(c *gin.Context) {
16821676
}
16831677

16841678
// 内网穿透:client端连接到server的IP:listen_port,转发到最终目标
1685-
clientURL := fmt.Sprintf("client://%s:%d/%s:%d?log=%s",
1679+
clientURL := fmt.Sprintf("client://%s:%d/%s:%d?log=%s&mode=2",
16861680
serverIP,
16871681
req.ListenPort,
16881682
clientConfig.TargetHost,

0 commit comments

Comments
 (0)