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

@ -74,6 +74,12 @@ func (h *ResolverEnhancer) FindHostByIP(ip net.IP) (string, bool) {
return "", false
}
func (h *ResolverEnhancer) InsertHostByIP(ip net.IP, host string) {
if mapping := h.mapping; mapping != nil {
h.mapping.Set(ip.String(), host)
}
}
func (h *ResolverEnhancer) PatchFrom(o *ResolverEnhancer) {
if h.mapping != nil && o.mapping != nil {
o.mapping.CloneTo(h.mapping)