mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-17 22:30:43 +08:00
opt sth
This commit is contained in:
@@ -18,11 +18,15 @@ var (
|
||||
hijackDNS []string
|
||||
)
|
||||
|
||||
// Register Monitor
|
||||
func RegisterMonitor(m S.Monitor) {
|
||||
monitor = m
|
||||
}
|
||||
|
||||
func RegisterFakeDNS(d D.FakeDNS, h string) {
|
||||
fakeDNS = d
|
||||
hijackDNS = append(hijackDNS, strings.Split(h, ",")...)
|
||||
}
|
||||
|
||||
// Session Operation
|
||||
func addSession(key interface{}, session *S.Session) {
|
||||
if monitor != nil {
|
||||
@@ -36,12 +40,6 @@ func removeSession(key interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
// Register FakeDNS
|
||||
func RegisterFakeDNS(d D.FakeDNS, h string) {
|
||||
fakeDNS = d
|
||||
hijackDNS = append(hijackDNS, strings.Split(h, ",")...)
|
||||
}
|
||||
|
||||
// Check target if is hijacked address.
|
||||
func isHijacked(target *net.UDPAddr) bool {
|
||||
if fakeDNS == nil {
|
||||
|
Reference in New Issue
Block a user