CODETABS(1)User CommandsCODETABS(1)

NAME

codetabs - fetch a public URL and return it with CORS headers

SYNOPSIS

GET /v1/proxy?quest=address
POST, PUT, DELETE, ... the same

DESCRIPTION

Fetches address and writes the answer back with Access-Control-Allow-Origin: *, so that a script on another origin may read it. The method, the headers and the body of the request are passed on. Runs without state or accounts.

EXAMPLES

codetabs: fetch any web address from here, with CORS headers on the answer

The answer as it came, status and headers included:
    curl 'https://www.codetabs.net/v1/proxy?quest=https://httpbun.com/anything/fetch-me'

Your method, headers and body are passed on:
    curl -X POST -H 'Content-Type: application/json' -d '{"a":1}' 'https://www.codetabs.net/v1/proxy?quest=https://httpbun.com/anything/post-me'

If you can only send a GET, name the method and the body in the query, before the address:
    curl 'https://www.codetabs.net/v1/proxy?verb=POST&body=a%3D1&quest=https://httpbun.com/anything/post-me'

From a web page:
    fetch('https://www.codetabs.net/v1/proxy?quest=https://httpbun.com/anything/fetch-me').then(r => r.text())

httpbun.com in these examples is a public test service that answers with a description of the request it got.

http and https only. Redirects are followed. No key, no account.

INTERACTIVE USE

Address:

DIAGNOSTICS

400
The address was not fetched: it is no address, or not a public one.
502
The other side could not be reached or did not answer in time.
anything else
The other side's own status, passed back.

BUGS

Answers larger than 5 MiB are cut. Cookies of the other side are not passed back. The section on caching was never written.

SEE ALSO

curl(1), fetch(3)


codetabs 0.9.22019-03-11CODETABS(1)