mirror of
https://github.com/twisterarmy/dnsseeder.git
synced 2025-08-30 15:52:09 +00:00
Support multiple initial IP's
This commit is contained in:
parent
d6d09aa925
commit
0855da80b2
13
seeder.go
13
seeder.go
@ -5,6 +5,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -105,12 +106,14 @@ func (s *dnsseeder) initSeeder() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// load one ip address into system and start crawling from it
|
// load ip addresses into system and start crawling from them
|
||||||
if len(s.theList) == 0 && s.initialIP != "" {
|
if len(s.theList) == 0 && s.initialIP != "" {
|
||||||
if newIP := net.ParseIP(s.initialIP); newIP != nil {
|
for _, initialIP := range strings.Split(s.initialIP, ",") {
|
||||||
// 1 at the end is the services flag
|
if newIP := net.ParseIP(initialIP); newIP != nil {
|
||||||
if x := s.addNa(wire.NewNetAddressIPPort(newIP, s.port, 1)); x == true {
|
// 1 at the end is the services flag
|
||||||
log.Printf("%s: crawling with initial IP %s \n", s.name, s.initialIP)
|
if x := s.addNa(wire.NewNetAddressIPPort(newIP, s.port, 1)); x == true {
|
||||||
|
log.Printf("%s: crawling with initial IP %s \n", s.name, s.initialIP)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user