mtulio / go-url

go-url is a cool URL tester that discovers all endpoints (IP address) and makes HTTP/S requests to each. It also can push metrics to the Pushgateway.
Apache License 2.0
5 stars 0 forks source link

Support ipv6 #13

Open mtulio opened 2 years ago

mtulio commented 2 years ago

Failing when running IPV6 address discovered on DNS lookup.

$ make run-sample 
go run *.go -dns -url='https://www.google.com/search?source=hp&q=google'
#> Reading config from Param
#> Found [1] URLs to test, starting...

URL=[(www.google.com) https://[2800:3f0:4001:834::2004]:443/search?source=hp&q=google] [FAIL] : 
     Get "https://[2800:3f0:4001:834::2004]:443/search?source=hp&q=google": dial tcp [2800:3f0:4001:834::2004]:443: socket: address family not supported by protocol [DNS 45 ms]
URL=[(www.google.com) https://172.217.29.4:443/search?source=hp&q=google] [  OK] : [200 OK] [288 ms] [DNS 45 ms]
Total time taken: 334ms
mtulio commented 2 years ago
$ make container-run-sample 
podman run -i \
    -v /home/mtulio/go/src/github.com/mtulio/go-url/hack/config-sample.json:/config-sample.json:Z \
    "mtulio/go-url:chore-structure" \
    -dns -config /config-sample.json
#> Reading config from JSON file: /config-sample.json
#> Found [4] URLs to test, starting...
URL=[                     http://grafana.internal:3000/]: [FAIL] - DNS [192 ms] Err: lookup grafana.internal on 10.0.2.3:53: no such host

URL=[       (ifconfig.co) http://[2606:4700:7::a29f:8a55]:80/json] [FAIL] : 
     Get "http://[2606:4700:7::a29f:8a55]:80/json": dial tcp [2606:4700:7::a29f:8a55]:80: socket: address family not supported by protocol [DNS 147 ms]
URL=[       (ifconfig.co) http://[2606:4700:7::a29f:8955]:80/json] [FAIL] : 
     Get "http://[2606:4700:7::a29f:8955]:80/json": dial tcp [2606:4700:7::a29f:8955]:80: socket: address family not supported by protocol [DNS 147 ms]
URL=[                 (ifconfig.co) http://162.159.137.85:80/json] [  OK] : [403 Forbidden] [103 ms] [DNS 147 ms]
URL=[                 (ifconfig.co) http://162.159.138.85:80/json] [  OK] : [403 Forbidden] [103 ms] [DNS 147 ms]

URL=[       (www.google.com) http://[2800:3f0:4001:80f::2004]:80/] [FAIL] : 
     Get "http://[2800:3f0:4001:80f::2004]:80/": dial tcp [2800:3f0:4001:80f::2004]:80: socket: address family not supported by protocol [DNS 5008 ms]
URL=[              (www.google.com)    http://142.251.128.100:80/] [  OK] : [200 OK] [173 ms] [DNS 5008 ms]

URL=[     (www.google.com) https://[2800:3f0:4001:80f::2004]:443/] [FAIL] : 
     Get "https://[2800:3f0:4001:80f::2004]:443/": dial tcp [2800:3f0:4001:80f::2004]:443: socket: address family not supported by protocol [DNS 5008 ms]
URL=[              (www.google.com)  https://142.251.128.100:443/] [  OK] : [200 OK] [329 ms] [DNS 5008 ms]
Total time taken: 5337ms