Skip to content
No description, website, or topics provided.
Go HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/authentication
web
LICENSE
README.md

README.md

Caddy http.internal example

http.internal can be used to protect resources. Authentication is handled by a backend. For this example it's written in Go.

Set up

  1. git clone this repo

caddy

Note: This is not meant to be used in a production environment. For production activate at least automatic HTTPS.

  1. download Caddy: https://caddyserver.com/download/darwin/amd64?license=personal&telemetry=off
  2. unpack and move binary into PATH
  3. $ cd ./web/
  4. $ caddy

go authenticaton app

  1. make sure go is installed
  2. $ cd ./cmd/authenticaton/
  3. $ go run main.go

test

unauthenticated:

  1. http://localhost:8080/internal → 404 Not Found
  2. http://localhost:8080/private/main.html → 404 Not Found

authenticated:

  1. http://localhost:8080/internal → 404 Not Found
  2. http://localhost:8080/private/main.html → 200 OK

notes

You can’t perform that action at this time.