Skip to content

Commit 7d5c3d1

Browse files
author
Angel Barrera
committed
Add TL;DR
1 parent b9cb1b0 commit 7d5c3d1

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
```

0 commit comments

Comments
 (0)