feat: 添加tls sni 嗅探

# Conflicts:
#	tunnel/statistic/tracker.go
#	tunnel/tunnel.go
This commit is contained in:
fishg
2022-03-30 23:54:52 +08:00
committed by yaling888
parent e877b68179
commit c495d314d4
5 changed files with 338 additions and 0 deletions

View File

@ -14,6 +14,7 @@ type Enhancer interface {
IsExistFakeIP(net.IP) bool
FindHostByIP(net.IP) (string, bool)
FlushFakeIP() error
InsertHostByIP(net.IP, string)
}
func FakeIPEnabled() bool {
@ -56,6 +57,12 @@ func IsExistFakeIP(ip net.IP) bool {
return false
}
func InsertHostByIP(ip net.IP, host string) {
if mapper := DefaultHostMapper; mapper != nil {
mapper.InsertHostByIP(ip, host)
}
}
func FindHostByIP(ip net.IP) (string, bool) {
if mapper := DefaultHostMapper; mapper != nil {
return mapper.FindHostByIP(ip)