cmd/mi: use user agent

This commit is contained in:
Cadey Ratio 2020-01-11 15:28:46 -05:00
parent 285db408be
commit 280f09d287
1 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import (
r "gopkg.in/rethinkdb/rethinkdb-go.v6" r "gopkg.in/rethinkdb/rethinkdb-go.v6"
"within.website/ln" "within.website/ln"
"within.website/ln/ex" "within.website/ln/ex"
"within.website/x/web/useragent"
) )
var ( var (
@ -35,12 +36,15 @@ var (
// Port // Port
port = flag.String("port", "5000", "HTTP port") port = flag.String("port", "5000", "HTTP port")
domain = flag.String("domain", "mi.within.website", "domain this is being served on")
) )
func main() { func main() {
flagenv.Parse() flagenv.Parse()
flag.Parse() flag.Parse()
http.DefaultTransport = useragent.Transport("mi-posse", "https://" + *domain + "/.within/botinfo", http.DefaultTransport)
ctx := context.Background() ctx := context.Background()
r.SetTags("rethinkdb", "json") r.SetTags("rethinkdb", "json")