https://github.com/pareshpawar/simple-http-server
Simple HTTP Server that returns ip address, headers and many other request data. use this as a test app to to deploy in your servers or practice to deploy
https://github.com/pareshpawar/simple-http-server
golang hacktoberfest simple-http-server
Last synced: 2 months ago
JSON representation
Simple HTTP Server that returns ip address, headers and many other request data. use this as a test app to to deploy in your servers or practice to deploy
- Host: GitHub
- URL: https://github.com/pareshpawar/simple-http-server
- Owner: pareshpawar
- License: gpl-3.0
- Created: 2023-07-11T09:32:03.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T07:16:50.000Z (over 1 year ago)
- Last Synced: 2024-10-25T02:57:56.173Z (over 1 year ago)
- Topics: golang, hacktoberfest, simple-http-server
- Language: Go
- Homepage:
- Size: 39.1 KB
- Stars: 6
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple HTTP Server in Go as a Container Image
[](https://github.com/pareshpawar/simple-http-server/actions/workflows/main.yml)
`simple-http-server` returns IP address, headers and many other request data. Use this as a test app to to deploy in your servers or practice to deploy. you can use this image in docker or kubernetes based deployments
### How it works?
- Starts listening on port 8081 for HTTP traffic
- On every request it returns following things:
- Request Type
- Hostname or Host of request
- Local IP of Container
- Remote IP
- All Request Headers
- And Environment Variable called `YOUR_ENV`
- optionally mount html dir to `/dist/html` to serve html pages
### How to use it?
- I've hosted this image on [Docker Hub](https://hub.docker.com/r/pareshpawar/simple-http-server) or you can build it yourself if you want to.
```bash
docker run --rm -p 8081:8081 pareshpawar/simple-http-server
```
- Optionally, forward port via your proxy or load balancer.
#### To Do
- [x] Make std output/logs colored and pretty 😅
- [x] Serving html file as output on ```/html/``` endpoint
- [x] create github actions for docker image build
- [ ] Add Environment Variable to switch text output to html output
- [ ] Serve a html pages from a external directory
- [ ] Add volume Env var to serve volume as http dir