← Docs

Proxy

Your endpoint is a URL, /<endpoint-id>/... on this site, shown at the top of the dashboard. Send it any HTTP request, with any method and path. Middleman records the request and answers it.

Without a target

With no target set, Middleman records the request and answers 200 with an empty body. This is all a guest endpoint does.

With a target

Set a target in the Config tab: an absolute http:// or https:// URL. Middleman forwards each request there and relays the target's answer back to the sender.

What Middleman changes

Which targets are allowed

The target must have a host. Targets that resolve to private, loopback or link-local addresses are refused when a request is forwarded (the sender gets a 502), so you cannot point Middleman at localhost or your internal network. To reach a service on your machine, expose it with a tunnel and use the tunnel's public URL.

Limits

LimitValueWhen exceeded
Request body1 MiB413
Target's response body1 MiB502
Whole exchange with the target, reading its answer included30 seconds502, or 500 if it runs out while the answer body is being read
Requests to your endpoint10 per second, bursts of 30429
Requests from one network address, to any endpoint50 per second, bursts of 200429
Forwarded requests3 per second, bursts of 10429
Forwards in flight at once10429

Requests answered with one of these errors are still recorded in History, with the reason. The exceptions are 404, and the 429 for one network address, which are answered before the request reaches your endpoint.

Error answers

Errors Middleman produces itself are JSON like {"message": "..."}, except the per-address 429, which is plain text.

StatusMeaning
404The id in the URL is not an endpoint, or a guest endpoint has expired.
400The saved target is not a valid URL. Fix it in the Config tab.
413The request body is over the limit.
422The endpoint's request template failed on the request and the endpoint's "On request template failure" setting is Reject (the default). Nothing was forwarded.
429A rate or concurrency limit was hit. Retry later.
502The target could not be reached or refused, took too long, or answered with a body over the limit.
500The target's answer could not be read to the end.

When a request template fails on a request, the failure is recorded in History and the Config tab's "On request template failure" setting decides what happens. Reject (the default) answers 422 and forwards nothing. Forward sends the original body on instead. Bodies that are not JSON, and empty bodies, skip the template and are forwarded unchanged.

← Docs