Skip to content

Commit 3e05855

Browse files
author
Dnfreddie
committed
Initial commit
0 parents  commit 3e05855

File tree

5 files changed

+82
-0
lines changed

5 files changed

+82
-0
lines changed

LICENSE

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The MIT License (MIT)
2+
Copyright © 2024 DnFreddie
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5+
6+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7+
8+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

network-traffic/index.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"title": "Network Traffic",
3+
"description": "Access services running inside an environment",
4+
"details": {
5+
"intro": {
6+
"text": "intro.md"
7+
},
8+
"steps": [
9+
{
10+
"title": "Run Nginx and access default page",
11+
"text": "step1.md"
12+
},
13+
{
14+
"title": "Run Apache and access default page",
15+
"text": "step2.md"
16+
}
17+
]
18+
},
19+
"backend": {
20+
"imageid": "ubuntu"
21+
}
22+
}

network-traffic/intro.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Access services running inside an environment

network-traffic/step1.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
> Services need to run on all interfaces (like 0.0.0.0) and not just localhost.
3+
<br>
4+
> Services need to be accessible via HTTP and **not** HTTPS.
5+
6+
Run Nginx on port 80 using Docker:
7+
8+
```
9+
docker run -p 80:80 nginx:alpine
10+
```{{exec}}
11+
12+
13+
Or run it in background:
14+
15+
```
16+
docker run -d -p 80:80 nginx:alpine
17+
```{{exec}}
18+
19+
Now access Nginx using this link:
20+
21+
[ACCESS NGINX]({{TRAFFIC_HOST1_80}})
22+
23+
It's also possible to access ports using the top-right navigation in the terminal.
24+
Or we can display the link to that page:
25+
26+
[ACCESS PORTS]({{TRAFFIC_SELECTOR}})
27+
28+
It's also possible to generate access URLs in bash (foreground or background scripts) like this:
29+
30+
```
31+
sed 's/PORT/80/g' /etc/killercoda/host
32+
```{{exec}}

network-traffic/step2.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
> Services need to run on all interfaces (like 0.0.0.0) and not just localhost.
3+
<br>
4+
> Services need to be accessible via HTTP and **not** HTTPS.
5+
6+
Expose Apache on port 1234 using Docker:
7+
8+
```
9+
docker run -d -p 1234:80 httpd:alpine
10+
```{{exec}}
11+
12+
Now access Apache using this link:
13+
14+
[ACCESS APACHE]({{TRAFFIC_HOST1_1234}})
15+
16+
It's also possible to access ports using the top-right navigation in the terminal.
17+
Or we can display the link to that page:
18+
19+
[ACCESS PORTS]({{TRAFFIC_SELECTOR}})

0 commit comments

Comments
 (0)