Skip to content

NatashaMitchko/middleware_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Middware Demo

We work at a super secret spy agency. Our super secret spies need to be able to access top secret information about where they need to drop the packagefor their super secret spy friends. Let's provide that information to them in a not-so-secure way by serving that info at 127.0.0.1:8080/rendezvous

The only way they can see it is if they know the super secret passcode.

To do this we will use http middleware!

For Demo

no middleware:

$ go run no_middleware.go &
$ curl -H "Password: 007" localhost:8080/rendezvous

with middleware:

$ go run middleware.go &
$ curl -v localhost:8080/rendezvous
$ curl -H "Password: 007" localhost:8080/rendezvous
$ curl -H "Password: 007" localhost:8080/enemy-spies
$ curl  -H "Password: 007" localhost:8080/secure-line

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages