소스 검색

fix xtcp cmd

fatedier 6 년 전
부모
커밋
ba45d29b7c
2개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 0
      client/visitor.go
  2. 2 2
      cmd/frpc/sub/xtcp.go

+ 2 - 0
client/visitor.go

@@ -280,6 +280,8 @@ func (sv *XtcpVisitor) handleConn(userConn frpNet.Conn) {
 		sv.Error("listen on visitorConn's local adress error: %v", err)
 		return
 	}
+	defer lConn.Close()
+
 	lConn.SetReadDeadline(time.Now().Add(5 * time.Second))
 	sidBuf := pool.GetBuf(1024)
 	n, _, err = lConn.ReadFromUDP(sidBuf)

+ 2 - 2
cmd/frpc/sub/xtcp.go

@@ -68,7 +68,7 @@ var xtcpCmd = &cobra.Command{
 		if role == "server" {
 			cfg := &config.XtcpProxyConf{}
 			cfg.ProxyName = prefix + proxyName
-			cfg.ProxyType = consts.StcpProxy
+			cfg.ProxyType = consts.XtcpProxy
 			cfg.UseEncryption = useEncryption
 			cfg.UseCompression = useCompression
 			cfg.Role = role
@@ -84,7 +84,7 @@ var xtcpCmd = &cobra.Command{
 		} else if role == "visitor" {
 			cfg := &config.XtcpVisitorConf{}
 			cfg.ProxyName = prefix + proxyName
-			cfg.ProxyType = consts.StcpProxy
+			cfg.ProxyType = consts.XtcpProxy
 			cfg.UseEncryption = useEncryption
 			cfg.UseCompression = useCompression
 			cfg.Role = role