rule: log next dialer in verbose mode. (#92)

Print out the next dialer is useful when a particular website does not load completely, and it helps when updating config rules.
This commit is contained in:
LJ authored and nadoo committed 2019-09-07 17:05:19 +08:00
1 parent 9595fcf0c0
commit 69bbaa809c
1 file changed
+6 -2
+6 -2
View File
@@ -99,12 +99,16 @@ func (rd *Dialer) NextDialer(dstAddr string) proxy.Dialer {
// Dial dials to targer addr and return a conn
func (rd *Dialer) Dial(network, addr string) (net.Conn, error) {
return rd.NextDialer(addr).Dial(network, addr)
d := rd.NextDialer(addr)
log.F("[Dial] %s => %s", addr, d.Addr())
return d.Dial(network, addr)
}
// DialUDP connects to the given address via the proxy
func (rd *Dialer) DialUDP(network, addr string) (pc net.PacketConn, writeTo net.Addr, err error) {
return rd.NextDialer(addr).DialUDP(network, addr)
d := rd.NextDialer(addr)
log.F("[DialUDP] %s => %s", addr, d.Addr())
return d.DialUDP(network, addr)
}
// AddDomainIP used to update ipMap rules according to domainMap rule