Skip to content

Commit

Permalink
fix xtcp cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
fatedier committed Mar 3, 2019
1 parent 3cf83f5 commit ba45d29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions client/visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions cmd/frpc/sub/xtcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ba45d29

Please sign in to comment.