GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - docker-client/echo-server

BranchesTags
Open more actions menu

Latest commit

 

History

240 Commits
240 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
linux
linux
 
 
src
src
 
 
windows
windows
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
terminal_input_explanation.md
terminal_input_explanation.md
 
 

Repository files navigation

echo-server

A cross-platform test server with support for HTTP/1.1 connection upgrades and deterministic scripted responses.

Multi-platform Docker images are available at gesellix/echo-server:<version> with <version> matching Git tags/releases on GitHub.

Supported platforms:

  • linux/amd64
  • linux/arm64/v8
  • windows-ltsc2022

๐Ÿš€ Features

  • HTTP/1.1 Upgrade Handling to raw TCP
  • Scripted deterministic responses via JSON body
  • Interactive commands in default mode (e.g. reset, set 10)
  • Cross-platform & container-friendly
  • Useful for client protocol testing and upgrade simulations

๐Ÿ”Œ HTTP/1.1 Upgrade Endpoint

POST /api/stream HTTP/1.1
Connection: Upgrade
Upgrade: testproto

The server upgrades the connection and speaks raw TCP after switching protocols.


๐Ÿงช Default Behavior

When no script is provided, the server enters a simple interactive loop:

  • Sends a counter every second:

    [0] scripted: counter: 0
    [1] scripted: counter: 1
    ...
    
  • Accepts basic commands from the client:

    • reset โ†’ resets counter
    • set <n> โ†’ sets counter to <n>
    • any other input โ†’ "unknown command"

You can connect using the built-in client or tools like nc:

go run ./src/hijack_client.go
# or
{ echo -en "GET /api/stream HTTP/1.1\r\nHost: localhost\r\nConnection: Upgrade\r\nUpgrade: testproto\r\n\r\n"; cat; } | nc localhost 8080

๐Ÿ“œ Scripted Responses (JSON)

Send a JSON payload with a POST request to /api/stream, along with Upgrade headers.

Example Request:

POST /api/stream HTTP/1.1
Host: localhost:8080
Connection: Upgrade
Upgrade: testproto
Content-Type: application/json

{
  "actions": [
    { "type": "response", "text": "first" },
    { "type": "delay",    "ms": 1000 },
    { "type": "response", "text": "second" },
    { "type": "close" }
  ]
}

Supported Actions:

Type Description Example
response Sends a line of text "text": "Hello"
delay Waits before next action (milliseconds) "ms": 500
close Closes the TCP connection (no parameters)

๐Ÿ“ Example Client

A simple Go client for interactive testing is available at:

./src/hijack_client.go

It connects to the server, performs the upgrade handshake, and allows typing commands live.


๐Ÿณ Docker

To run via Docker:

docker run --rm -it -p 8080:8080 gesellix/echo-server:<version>

๐Ÿ“ซ Feedback

Issues and contributions welcome via GitHub.

About

No description or website provided.

Topics

hacktoberfest

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.