File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,3 +6,38 @@ This project offers a way to securize your backends with a basic golang reverse
66
77## TLDR;
88
9+ Expose your services with basic authentication.
10+
11+ ``` bash
12+ $ wget -O basic-auth-reverse-proxy.tar.gz -q https://github.com/angelbarrera92/basic-auth-reverse-proxy/releases/download/v0.1.2/basic-auth-reverse-proxy_0.1.2_linux_amd64.tar.gz
13+ $ tar -zxvf basic-auth-reverse-proxy.tar.gz
14+ README.md
15+ basic-auth-reverse-proxy
16+ $ cat >> authn.yaml << EOL
17+ users:
18+ - username: Angel
19+ password: Barrera
20+ EOL
21+ $ ./basic-auth-reverse-proxy serve
22+ ```
23+
24+ Then a local server is started. Try to access it:
25+
26+ ``` bash
27+ $ curl http://localhost:11811/get
28+ Unauthorised
29+ $ curl http://Angel:Barrera@localhost:11811/get
30+ {
31+ " args" : {},
32+ " headers" : {
33+ " Accept" : " */*" ,
34+ " Accept-Encoding" : " gzip" ,
35+ " Authorization" : " Basic QW5nZWw6QmFycmVyYQ==" ,
36+ " Host" : " httpbin.org" ,
37+ " User-Agent" : " curl/7.58.0" ,
38+ " X-Forwarded-Host" : " localhost:11811"
39+ },
40+ " origin" : " 127.0.0.1, 80.25.227.133, 127.0.0.1" ,
41+ " url" : " https://localhost:11811/get"
42+ }
43+ ```
You can’t perform that action at this time.
0 commit comments