Skip to content

Commit

Permalink
Server-side UDP disabled by default
Browse files Browse the repository at this point in the history
Use -udp flag to turn on UDP support on server
  • Loading branch information
riobard committed Jun 23, 2020
1 parent 1b56d9d commit 172f9e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func main() {
TCPTun string
UDPTun string
UDPSocks bool
UDP bool
Plugin string
PluginOpts string
}
Expand All @@ -57,6 +58,7 @@ func main() {
flag.StringVar(&flags.UDPTun, "udptun", "", "(client-only) UDP tunnel (laddr1=raddr1,laddr2=raddr2,...)")
flag.StringVar(&flags.Plugin, "plugin", "", "Enable SIP003 plugin. (e.g., v2ray-plugin)")
flag.StringVar(&flags.PluginOpts, "plugin-opts", "", "Set SIP003 plugin options. (e.g., \"server;tls;host=mydomain.me\")")
flag.BoolVar(&flags.UDP, "udp", false, "(server-only) enable UDP support")
flag.DurationVar(&config.UDPTimeout, "udptimeout", 5*time.Minute, "UDP tunnel timeout")
flag.Parse()

Expand Down Expand Up @@ -166,7 +168,9 @@ func main() {
log.Fatal(err)
}

go udpRemote(udpAddr, ciph.PacketConn)
if flags.UDP {
go udpRemote(udpAddr, ciph.PacketConn)
}
go tcpRemote(addr, ciph.StreamConn)
}

Expand Down

0 comments on commit 172f9e0

Please sign in to comment.