Connectivity Test Server

A simple HTTP server for connectivity testing. It can be run from the command line or in a container.

The Python version relies only on Python's standard library, so it should work in any environment with Python installed. The Node.js version also relies only on the standard library, so it should work in any environment with Node.js installed.

It displays a simple HTML or plain-text page with the client's IP address and any detected X-* headers.

Disclaimer

The ok-server scripts were generated using AI under human supervision. The owner of the repository is not responsible for any issues that may arise from using the AI-generated code.

Usage

Command Line

To run the server from the command line:

python3 ok-server.py
python3 ok-server.py --look basic
python3 ok-server.py --bind 127.0.0.1 --port 8080 --look tailwind

--look accepts basic, nice, bootstrap, or tailwind. You can override the look per request with the look query parameter, for example: http://localhost:8080/?look=tailwind

node ok-server.mjs
node ok-server.mjs --look basic
node ok-server.mjs --bind 127.0.0.1 --port 8080 --look tailwind

Connect to the server using a web browser or a tool like curl:

curl -si "http://localhost:8080"

Docker

Use the included Dockerfile to build and run the server in a Docker container:

docker build -t ok-server .
docker run -d --restart unless-stopped --name ok-server --cpus=1 --memory=256m -p 8080:8080 ok-server

This will start the server and expose it on port 8080. The container will run until stopped. You can restart it with docker start ok-server, or remove it with docker rm ok-server.

Container CLI on a Mac

container builder stop
container builder start -c 4 -m 1G
container build -t ok-server .
container run --rm -d --name ok-server -c 1 -m 256m -p 8080:8080 ok-server

This will start the server and expose it on port 8080. The container will run until stopped, and will be removed when stopped. You can stop it with container stop ok-server.

License

This project is licensed under the MIT License. See the LICENSE file for details.

S
Description
A simple HTTP server designed for performing connectivity tests. May be run from command line or using a container.
Readme MIT 4.9 MiB
Languages
Python 35.1%
JavaScript 34.2%
Go 30.2%
Dockerfile 0.4%
Shell 0.1%