|
5 | 5 | "crypto/tls"
|
6 | 6 | "flag"
|
7 | 7 | "fmt"
|
| 8 | + "net" |
8 | 9 | "net/http"
|
9 | 10 | "os"
|
10 | 11 | "strings"
|
@@ -51,9 +52,14 @@ func main() {
|
51 | 52 | timeout := time.Duration(to * 1000000)
|
52 | 53 |
|
53 | 54 | var tr = &http.Transport{
|
54 |
| - MaxIdleConns: 30, |
55 |
| - IdleConnTimeout: time.Second, |
56 |
| - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, |
| 55 | + MaxIdleConns: 30, |
| 56 | + IdleConnTimeout: time.Second, |
| 57 | + DisableKeepAlives: true, |
| 58 | + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, |
| 59 | + DialContext: (&net.Dialer{ |
| 60 | + Timeout: timeout, |
| 61 | + KeepAlive: time.Second, |
| 62 | + }).DialContext, |
57 | 63 | }
|
58 | 64 |
|
59 | 65 | re := func(req *http.Request, via []*http.Request) error {
|
@@ -105,29 +111,29 @@ func main() {
|
105 | 111 |
|
106 | 112 | // Adding port templates
|
107 | 113 | xlarge := []string{"81", "300", "591", "593", "832", "981", "1010", "1311", "2082", "2087", "2095", "2096", "2480", "3000", "3128", "3333", "4243", "4567", "4711", "4712", "4993", "5000", "5104", "5108", "5800", "6543", "7000", "7396", "7474", "8000", "8001", "8008", "8014", "8042", "8069", "8080", "8081", "8088", "8090", "8091", "8118", "8123", "8172", "8222", "8243", "8280", "8281", "8333", "8443", "8500", "8834", "8880", "8888", "8983", "9000", "9043", "9060", "9080", "9090", "9091", "9200", "9443", "9800", "9981", "12443", "16080", "18091", "18092", "20720", "28017"}
|
108 |
| - large := []string{"81","591","2082","2087","2095","2096","3000","8000","8001","8008","8080","8083","8443","8834","8888"} |
109 |
| - |
| 114 | + large := []string{"81", "591", "2082", "2087", "2095", "2096", "3000", "8000", "8001", "8008", "8080", "8083", "8443", "8834", "8888"} |
| 115 | + |
110 | 116 | // submit any additional proto:port probes
|
111 | 117 | for _, p := range probes {
|
112 | 118 | switch p {
|
113 | 119 | case "xlarge":
|
114 | 120 | for _, port := range xlarge {
|
115 |
| - urls <- fmt.Sprintf("http://%s:%s", domain, port) |
116 |
| - urls <- fmt.Sprintf("https://%s:%s", domain, port) |
117 |
| - } |
| 121 | + urls <- fmt.Sprintf("http://%s:%s", domain, port) |
| 122 | + urls <- fmt.Sprintf("https://%s:%s", domain, port) |
| 123 | + } |
118 | 124 | case "large":
|
119 | 125 | for _, port := range large {
|
120 |
| - urls <- fmt.Sprintf("http://%s:%s", domain, port) |
121 |
| - urls <- fmt.Sprintf("https://%s:%s", domain, port) |
122 |
| - } |
| 126 | + urls <- fmt.Sprintf("http://%s:%s", domain, port) |
| 127 | + urls <- fmt.Sprintf("https://%s:%s", domain, port) |
| 128 | + } |
123 | 129 | default:
|
124 | 130 | pair := strings.SplitN(p, ":", 2)
|
125 |
| - if len(pair) != 2 { |
126 |
| - continue |
127 |
| - } |
| 131 | + if len(pair) != 2 { |
| 132 | + continue |
| 133 | + } |
128 | 134 | urls <- fmt.Sprintf("%s://%s:%s", pair[0], domain, pair[1])
|
129 | 135 | }
|
130 |
| - } |
| 136 | + } |
131 | 137 | }
|
132 | 138 |
|
133 | 139 | // once we've sent all the URLs off we can close the
|
|
0 commit comments