From 47b10c2d70087d05e9511a514bcee5bce9b433f1 Mon Sep 17 00:00:00 2001 From: MDLeom <2809763-curben@users.noreply.gitlab.com> Date: Wed, 3 Jun 2020 05:57:44 +0100 Subject: [PATCH] post: Onion-Location --- source/_posts/onion-location-redirect.md | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 source/_posts/onion-location-redirect.md diff --git a/source/_posts/onion-location-redirect.md b/source/_posts/onion-location-redirect.md new file mode 100644 index 0000000..1af8278 --- /dev/null +++ b/source/_posts/onion-location-redirect.md @@ -0,0 +1,53 @@ +--- +title: "Onion-Location: redirect your cleanet website to .onion" +excerpt: Supported in Tor Browser >=9.5 +date: 2020-06-03 +tags: +- tor +--- + +Tor Browser recently introduced "Onion Location" feature to enable a (cleanet) website to advertise its onion service to users of Tor Browser by adding an HTTP header. When visiting a cleanet website that has onion service available and the relevant HTTP header, Tor Browser will display a ".onion available" button on the address bar. When user clicks on it, Tor Browser will redirects to the .onion address of the website. User could also opt-in the "Always Prioritise Onions" option and Tor Browser will automatically redirects to a website's .onion if detected. + +![.onion button](20200603/onion-location.png) + +![Redirected to onion service](20200603/redirected-onion.png) + +The HTTP header is: + +``` +Onion-Location: http://xxx.onion +``` + +## Caddy + +In Caddy, the header can be added by: + +``` plain v1 +example.com { + header / { + Onion-Location "http://xxx.onion" + } +} +``` + +``` plain v2 +example.com { + header { + Onion-Location "http://xxx.onion" + } +} +``` + +## tag + +If you don't have access to the web server to add the header (e.g. GitHub/GitLab Pages), you can add `` tag instead. + +The tag should be added in ``: + +``` html + + + + + +```