Feature: add tls SNI sniffing (#68)

This commit is contained in:
fishg
2022-03-30 23:54:52 +08:00
committed by yaling888
parent 9ff1f5530e
commit 24ce6622a2
5 changed files with 337 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)