{"id":13581780,"url":"https://github.com/ricoberger/echoserver","last_synced_at":"2026-02-13T13:20:08.174Z","repository":{"id":99630865,"uuid":"342229883","full_name":"ricoberger/echoserver","owner":"ricoberger","description":"Simple echoserver, which dumps HTTP requests","archived":false,"fork":false,"pushed_at":"2025-04-27T09:06:17.000Z","size":103,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-28T14:13:57.982Z","etag":null,"topics":["docker","echoserver","go","golang","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ricoberger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["ricoberger"],"custom":["https://www.paypal.me/ricoberger"]}},"created_at":"2021-02-25T11:59:17.000Z","updated_at":"2025-04-27T09:06:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd583eb2-93c7-4ca9-ad8b-1362a94bf5b8","html_url":"https://github.com/ricoberger/echoserver","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricoberger%2Fechoserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricoberger%2Fechoserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricoberger%2Fechoserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricoberger%2Fechoserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricoberger","download_url":"https://codeload.github.com/ricoberger/echoserver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251326851,"owners_count":21571636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","echoserver","go","golang","kubernetes"],"created_at":"2024-08-01T15:02:14.409Z","updated_at":"2026-02-13T13:20:08.160Z","avatar_url":"https://github.com/ricoberger.png","language":"Go","funding_links":["https://github.com/sponsors/ricoberger","https://www.paypal.me/ricoberger"],"categories":["Go"],"sub_categories":[],"readme":"# echoserver\n\nThe `echoserver` is a HTTP / gRPC server written in Go, which was mainly written\nto dump HTTP requests. Nowdays it can also be used to test / showcase the\ninstrumentation of a Go application with metrics, logs, traces and profiles. It\ncan also be used to test the timeout / header size configuration of a reverse\nproxy.\n\n## Building and Running\n\nTo build and run the `echoserver` the following commands can be used:\n\n```sh\nmake build\n./bin/echoserver\n```\n\nVia Docker the following commands can be used to build the image and run the\n`echoserver`:\n\n```sh\ndocker build -f ./cmd/echoserver/Dockerfile -t ghcr.io/ricoberger/echoserver:latest .\ndocker run -it --rm --name echoserver -p 8080:8080 ghcr.io/ricoberger/echoserver:latest\n```\n\nThe `echoserver` can also be deployed on Kubernetes via Helm:\n\n```sh\nhelm upgrade --install echoserver oci://ghcr.io/ricoberger/charts/echoserver --version \u003cVERSION\u003e\n```\n\n## Configuration\n\n```plantext\nUsage: echoserver [flags]\n\nFlags:\n  -h, --help                           Show context-sensitive help.\n      --http-server.address=\":8080\"    The address where the server should listen on ($HTTP_SERVER_ADDRESS).\n```\n\n```sh\n# Configure an OTLP/gRPC or OTLP/HTTP endpoint for traces, metrics, and logs.\n# To configure different endpoints for traces, metrics, and logs, use the\n# OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, OTEL_EXPORTER_OTLP_METRICS_ENDPOINT,\n# and OTEL_EXPORTER_OTLP_LOGS_ENDPOINT environment variables.\nexport OTEL_EXPORTER_OTLP_ENDPOINT=\"localhost:4317\"\n# Set the logs exporter which should be used. Valid values are \"console\",\n# \"otlp\" and \"none\". The default value is \"none\".\nexport OTEL_LOGS_EXPORTER=\"console\"\n# Set the metrics exporter which should be used. Valid values are \"console\",\n# \"otlp\", \"prometheus\" and \"none\". The default value is \"none\".\nexport OTEL_METRICS_EXPORTER=\"console\"\n# Set the traces exporter which should be used. Valid values are \"console\",\n# \"otlp\" and \"none\". The default value is \"none\".\nexport OTEL_TRACES_EXPORTER=\"console\"\n# Key-value pairs to be used as resource attributes. This can be used to\n# overwrite the default service name / version and to set additional attributes,\n# like the Kubernetes Pod name, etc.\nexport OTEL_RESOURCE_ATTRIBUTES=service.name=my-service,service.version=1.0.0\n# Enable resource detectors. Valid values are \"container\", \"host\", \"os\",\n# \"process\", and \"sdk\".\nexport OTEL_RESOURCE_DETECTORS=\"container,host,os,process,sdk\"\n\n# When \"OTEL_LOGS_EXPORTER\" is set to \"console\", the following environment\n# variables can be used to configure the logging output:\n# - LOG_FORMAT: Set the output format of the logs. Must be \"console\" or \"json\".\n# - LOG_LEVEL: Set the log level. Must be \"DEBUG\", \"INFO\", \"WARN\" or \"ERROR\".\n# - LOG_RESOURCE_ATTRIBUTES: Define if the resource attributes should be logged.\n#   Must be \"true\" or \"false\".\nexport LOG_FORMAT=\"console\"\nexport LOG_LEVEL=\"INFO\"\nexport LOG_RESOURCE_ATTRIBUTES=\"true\"\n```\n\n## Usage\n\n### HTTP Endpoints\n\n- `/`: Dump the HTTP request.\n- `/health`: Returns a 200 status code.\n- `/panic`: Panics within the http handler and returns a status code 500.\n- `/status`: Returns a random status code, when the `status` parameter is empty\n  or `random`. Return the status code specified in the `status` parameter, e.g.\n  `?status=200`.\n- `/timeout`: Wait the given amount of time (`?timeout=1m`) before returning a\n  200 status code.\n- `/headersize`: Returns a 200 status code with a header `X-Header-Size` of the\n  size defined via `?size=1024`.\n- `/request`: Returns the response of the requested server. The request body\n  should have the following structure:\n  `{\"method\": \"POST\", \"url\": \"http://localhost:8080/\", \"body\": \"test\", \"headers\": {\"x-test\": \"test\"}}`\n- `/fibonacci`: Returns the Fibonacci number for the given `n` parameter, e.g.\n  `?n=100`. The intention behind this endpoint is to simulate a CPU-intensive\n  task.\n- `/websocket`: Can be used to test WebSocket connections. It returns the\n  message sent over the WebSocket connection.\n- `/metrics`: Returns the captured Prometheus metrics.\n\n### gRPC Endpoints\n\n- `Echoserver.Echo`: Echoes the message sent in the request.\n- `Echoserver.Status`: Returns a gRPC error with the status specified in the\n  `status` field of the request or a random gRPC error when the value of the\n  `status` field is `random`.\n- `Echoserver.Request`: Forwards the request to the specified gRPC endpoint and\n  returns the response. The request message should have the following structure:\n  `{\"uri\": \"localhost:8081\", \"method\": \"Echoserver.Echo\", \"message\": \"{ \\\"message\\\": \\\"Hello\\\" }\"}`\n\n### Examples\n\n```sh\ncurl -vvv \"http://localhost:8080/\"\ncurl -vvv \"http://localhost:8080/panic\"\ncurl -vvv \"http://localhost:8080/status\"\ncurl -vvv \"http://localhost:8080/status?status=400\"\ncurl -vvv \"http://localhost:8080/timeout?timeout=10s\u0026flush=2s\"\ncurl -vvv \"http://localhost:8080/headersize?size=100\"\ncurl -vvv -X POST -d '{\"method\": \"POST\", \"url\": \"http://localhost:8080/\", \"body\": \"test\", \"headers\": {\"x-test\": \"test\"}}' http://localhost:8080/request\ncurl -vvv \"http://localhost:8080/fibonacci?n=100\"\n```\n\n```sh\ngrpcurl -format-error -plaintext -d '{ \"message\": \"Hello\" }' 'localhost:8081' Echoserver.Echo\ngrpcurl -format-error -plaintext -d '{ \"status\": \"random\" }' 'localhost:8081' Echoserver.Status\ngrpcurl -format-error -plaintext -d '{ \"uri\": \"localhost:8081\", \"method\": \"Echoserver.Status\", \"message\": \"{ \\\"status\\\": \\\"random\\\" }\" }' 'localhost:8081' Echoserver.Request\ngrpcurl -format-error -plaintext -d '{ \"uri\": \"localhost:8081\", \"method\": \"Echoserver.Echo\", \"message\": \"{ \\\"message\\\": \\\"Hello\\\" }\" }' 'localhost:8081' Echoserver.Request\n\n# List endpoints, list methods for a specific endpoint and describe a method\ngrpcurl -plaintext 'localhost:8081' list\ngrpcurl -plaintext 'localhost:8081' list Echoserver\ngrpcurl -plaintext 'localhost:8081' describe Echoserver.Echo\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricoberger%2Fechoserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricoberger%2Fechoserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricoberger%2Fechoserver/lists"}