-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
golink: listen on HTTPS and redirect HTTP traffic
Updates #9 On tailnets with TLS enabled serve HTTP traffic with a separate redirectHandler which sends requests to our HTTPS listener destination. Add `-L` to documented examples of using `curl` to follow these redirects if present. Signed-off-by: Patrick O'Doherty <[email protected]>
- Loading branch information
Showing
2 changed files
with
79 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,15 +114,15 @@ <h2 id="api">Application Programming Interface (API)</h2> | |
Visit <a href="/.export">go/.export</a> to export all saved links and their metadata in <a href="https://jsonlines.org/">JSON Lines format</a>. | ||
This is useful to create data snapshots that can be restored later. | ||
|
||
<pre>{{`$ curl go/.export | ||
<pre>{{`$ curl -L go/.export | ||
{"Short":"go","Long":"http://go","Created":"2022-05-31T13:04:44.741457796-07:00","LastEdit":"2022-05-31T13:04:44.741457796-07:00","Owner":"[email protected]","Clicks":1} | ||
{"Short":"slack","Long":"https://company.slack.com/{{if .Path}}channels/{{PathEscape .Path}}{{end}}","Created":"2022-06-17T18:05:43.562948451Z","LastEdit":"2022-06-17T18:06:35.811398Z","Owner":"[email protected]","Clicks":4}`}} | ||
</pre> | ||
|
||
<p> | ||
Create a new link by sending a POST request with a <code>short</code> and <code>long</code> value: | ||
|
||
<pre>{{`$ curl -d short=cs -d long=https://cs.github.com/ go | ||
<pre>{{`$ curl -L -d short=cs -d long=https://cs.github.com/ go | ||
{"Short":"cs","Long":"https://cs.github.com/","Created":"2022-06-03T22:15:29.993978392Z","LastEdit":"2022-06-03T22:15:29.993978392Z","Owner":"[email protected]"}`}} | ||
</pre> | ||
|
||
|