An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# Simple HTTP Server in Go as a Container Image
[![ci](https://github.com/pareshpawar/simple-http-server/actions/workflows/main.yml/badge.svg)](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