Allow user to specify URLs on the command line, and use that to allow per-target tokens. (#1901)

Also:
- Parse targets on startup and catch badly formed ones before Scope can start.
- If no port is specified, use default port for scheme; if no scheme is specificed, use 4040.
- Use username as probe token
This commit is contained in:
Tom Wilkie
2016-10-05 10:59:56 -07:00
committed by GitHub
parent 0cc794248b
commit 2a00fd2d78
12 changed files with 365 additions and 139 deletions

View File

@@ -6,6 +6,7 @@ import (
"fmt"
"io/ioutil"
"log"
"net/url"
"time"
"github.com/ugorji/go/codec"
@@ -45,11 +46,16 @@ func main() {
}
}
url, err := url.Parse(fmt.Sprintf("http://%s", *publish))
if err != nil {
log.Fatal(err)
}
client, err := appclient.NewAppClient(appclient.ProbeConfig{
Token: *publishToken,
ProbeID: *publishID,
Insecure: false,
}, *publish, *publish, nil)
}, *publish, *url, nil)
if err != nil {
log.Fatal(err)
}