Skip to content

kschaper/caddy-internal-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published