add hijackDNS opt

This commit is contained in:
Jason
2019-08-16 20:29:30 +08:00
parent c871e3d98e
commit 78dfd36759
5 changed files with 37 additions and 15 deletions

View File

@@ -54,6 +54,7 @@ type CmdArgs struct {
FakeIPRange *string
FakeDNSAddr *string
FakeDNSHosts *string
HijackDNS *string
// Session Stats
EnableStats *bool
@@ -142,7 +143,7 @@ func main() {
proxy.RegisterMonitor(monitor)
// Register TCP and UDP handlers to handle accepted connections.
core.RegisterTCPConnHandler(proxy.NewTCPHandler(proxyHost, proxyPort))
core.RegisterUDPConnHandler(proxy.NewUDPHandler(proxyHost, proxyPort, *args.UdpTimeout))
core.RegisterUDPConnHandler(proxy.NewUDPHandler(proxyHost, proxyPort, *args.UdpTimeout, *args.HijackDNS))
// Register an output callback to write packets output from lwip stack to tun
// device, output function should be set before input any packets.