Refactor README for clarity and add Node.js server implementation

This commit is contained in:
2026-03-27 12:04:23 +01:00
parent 83fd45bebd
commit aa2d51a0dd
2 changed files with 339 additions and 3 deletions

View File

@@ -1,12 +1,14 @@
# Connectivity Test Server
A simple HTTP server for connectivity testing. It can be run from the command line or in a container. It relies only on Python's standard library, so it should work in any environment with Python installed.
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.py` file was 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.
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
@@ -23,8 +25,18 @@ python3 ok-server.py --bind 127.0.0.1 --port 8080 --look bootstrap
`--look` accepts `basic`, `nice`, or `bootstrap`.
You can override the look per request with the `look` query parameter, for example:
or
```bash
curl -i "http://localhost:8000/?look=basic"
node ok-server.js
node ok-server.js --look basic
node ok-server.js --bind 127.0.0.1 --port 8080 --look bootstrap
```
Connect to the server using a web browser or a tool like `curl`:
```bash
curl -si "http://localhost:8000"
```
### Docker