MCPcopy
hub / github.com/XTLS/RealiTLScanner / LookupIP

Function LookupIP

utils.go:159–174  ·  view source on GitHub ↗
(addr string)

Source from the content-addressed store, hash-verified

157 return hostChan
158}
159func LookupIP(addr string) (net.IP, error) {
160 ips, err := net.LookupIP(addr)
161 if err != nil {
162 return nil, fmt.Errorf("failed to lookup: %w", err)
163 }
164 var arr []net.IP
165 for _, ip := range ips {
166 if ip.To4() != nil || enableIPv6 {
167 arr = append(arr, ip)
168 }
169 }
170 if len(arr) == 0 {
171 return nil, errors.New("no IP found")
172 }
173 return arr[0], nil
174}
175func RemoveDuplicateStr(strSlice []string) []string {
176 allKeys := make(map[string]bool)
177 var list []string

Callers 2

ScanTLSFunction · 0.85
IterateAddrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected