Rucho

Returns a small sample XML document as `application/xml`.

Deliberately non-JSON — a controllable upstream for testing how a gateway
handles application/xml responses (e.g. content-type-aware plugins).

get
https://rucho.org/xml

Response

200 application/xml

A sample XML document

string
get/xml
 
200 application/xml

Returns a small sample image in the requested `format`.

Supported: png, jpeg (alias jpg), svg, webp — any other value
returns 400. Each returns a tiny fixed image with the matching
Content-Type, as a controllable upstream for testing gateway handling of
binary/image bodies.

get
https://rucho.org/image/{format}

Path Parameters

formatstringrequired

Image format: png, jpeg, svg, or webp

Response

A sample image in the requested format

get/image/{format}
 

Handler for the `/metrics` endpoint.

Returns a JSON object containing:

  • all_time: Total requests, successes, failures, and per-endpoint hits since server start
  • last_hour: Same metrics but only for the last 60 minutes (rolling window)

Example Response

{
"all_time": {
"total_requests": 1000,
"successes": 950,
"failures": 50,
"endpoint_hits": {
"/get": 500,
"/post": 300,
"/status/:code": 200
}
},
"last_hour": {
"total_requests": 100,
"successes": 95,
"failures": 5,
"endpoint_hits": {
"/get": 50,
"/post": 30,
"/status/:code": 20
}
}
}
get
https://rucho.org/metrics

Response

200 application/json

Request statistics as JSON: all_time totals plus a rolling last_hour window, each with total/success/failure counts and per-endpoint hits. Only mounted when metrics_enabled is set — otherwise the route returns 404.

get/metrics
 
200 application/json

Returns `n` bytes of deterministic content with range-request support.

Without a Range header: 200 OK, full body, Accept-Ranges: bytes.
With a satisfiable Range: 206 Partial Content + Content-Range.
With an unsatisfiable Range: 416 Range Not Satisfiable + Content-Range: bytes */n.
n is capped at MAX_BYTES_RESPONSE_SIZE (10 MiB); larger values return 400.

get
https://rucho.org/range/{n}

Path Parameters

nintegerrequired

Total number of bytes the resource represents (max 10485760)

>= 0

Response

application/octet-stream

Full body (no Range header)

string
get/range/{n}
 
application/octet-stream

Handles requests to the `/redirect/:n` endpoint.

Returns a 302 redirect chain that decrements n on each hop.
When n reaches 1, redirects to /get as the final destination.
When n is 0, returns 200 directly (redirect complete).

Security

The maximum number of hops is capped at MAX_REDIRECT_HOPS (20) to prevent
abuse through excessively long redirect chains.

head
https://rucho.org/redirect/{n}

Path Parameters

ninteger(int32)required

>= 0

Response

text/plain

Redirect complete (when n=0)

string
head/redirect/{n}
 
text/plain