Skip to content

Commit

Permalink
use uritemplate.MustNew
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Sep 19, 2024
1 parent 8dcf78d commit 4e24068
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions content/docs/masque/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ weight: 2
A client needs to be configured with the same URI template as the proxy. For more information on URI templates, see the [URI Templates]({{< relref "proxy#uri-templates" >}}) section on the proxy page.

```go
t, err := uritemplate.New("https://example.org:4443/masque?h={target_host}&p={target_port}")
// ... handle error ...
t := uritemplate.MustNew("https://example.org:4443/masque?h={target_host}&p={target_port}")
cl := masque.Client{
Template: t,
}
Expand Down
2 changes: 1 addition & 1 deletion content/docs/masque/proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ When receiving a request at the specified HTTP handler, the server decodes the U
To run a CONNECT-UDP proxy on `https://example.org:4443` with the URI template `https://example.org:4443/masque?h={target_host}&p={target_port}`:

```go
t, err := uritemplate.New("https://example.org:4443/masque?h={target_host}&p={target_port}")
t := uritemplate.MustNew("https://example.org:4443/masque?h={target_host}&p={target_port}")
// ... error handling
var proxy masque.Proxy
http.Handle("/masque", func(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit 4e24068

Please sign in to comment.