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

go-url

Go-url is an tool to make HTTP requests on command line.

The big differencial are:

Install

from source code

install from latest version

Usage

-config

Read URLs tests from config:

go run *.go -config hack/config-sample.json

sample stdout

-dns

Force to resolve DNS and test on each IP address endpoint

go run *.go -config hack/config-sample.json -dns

sample stdout

-url

Read url from option -url

go run *.go -url https://www.google.com

sample stdout

-header

Supporting header option

go-url -dns -watch-period 20 -watch-interval 2 -header "user-agent=eu" https://www.google.com

or more advanced in config (url item):

    {
      "url": "https://www.google.com/",
      "headers": {
        "user-agent": "gurl"
      }
    },

-watch-*

Add a option to watch requests (repeat requests):

go-url -dns -watch-period 20 -watch-interval 2 https://www.google.com

Argument

Read url from argument (argv[1])

./bin/go-url https://www.google.com

sample stdout

Docker

Run with multiple options:

docker run \
    -v $PWD/hack/config-sample.json:/config.json \
    -i mtulio/go-url:docker \
    -dns -config /config.json
docker run \
    -v $PWD/hack/config-sample.json:/config.json \
    -i mtulio/go-url:docker https://g1.globo.com

sample stdout

Metrics

make test-run-metrics-stack

HOSTNAME=MyNode go run *.go \
    -dns \
    -url=http://www.google.com \
    -metric=http://localhost:9091

sample stdout

screenshot from 2018-10-19 02-27-23

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Open an Issue or PR. =]