diff --git a/client.go b/client.go index 960b7b1..0b7c918 100644 --- a/client.go +++ b/client.go @@ -51,7 +51,7 @@ func (r *Request) Hostname() string { return hostname(r.Host) } -// NewRequest returns a new request. The host is inferred from the provided url. +// NewRequest returns a new request. The host is inferred from the provided URL. func NewRequest(rawurl string) (*Request, error) { u, err := url.Parse(rawurl) if err != nil { @@ -71,9 +71,9 @@ func NewRequest(rawurl string) (*Request, error) { }, nil } -// NewProxyRequest returns a new request using the provided host. -// The provided host must contain a port. -func NewProxyRequest(host, rawurl string) (*Request, error) { +// NewRequestTo returns a new request for the provided URL to the provided host. +// The host must contain a port. +func NewRequestTo(rawurl, host string) (*Request, error) { u, err := url.Parse(rawurl) if err != nil { return nil, err diff --git a/examples/client/client.go b/examples/client/client.go index c83fb88..12eaf04 100644 --- a/examples/client/client.go +++ b/examples/client/client.go @@ -66,7 +66,7 @@ func sendRequest(req *gmi.Request) error { case gmi.StatusClassRedirect: fmt.Println("Redirecting to", resp.Meta) // Make the request to the same host - red, err := gmi.NewProxyRequest(req.Host, resp.Meta) + red, err := gmi.NewRequestTo(req.Host, resp.Meta) if err != nil { return err }