ctCodeTabs Wiki

the members' box: notes, services, things that should be written down

Recent Changes · Media Manager · Sitemap · Log In
You are here: start » services » corsproxy
Table of Contents
  • corsproxy
    • How to use it
    • Try it
    • Notes

corsproxy

Shared CORS relay for browser scripts. Left running on the club box so members do not have to run their own.

It fetches whatever address you give it and hands the answer back with the header that lets a script on another site read it. Open to everybody, members or not.

How to use it

CodeTabs Wiki: 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.org/v1/proxy?quest=https://httpbin.org/anything/fetch-me'

As JSON, with "responseBody", "statusCode", "contentType", "finalUrl" and "responseHeaders":
    curl 'https://www.codetabs.org/v1/wrap?quest=https://httpbin.org/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.org/v1/proxy?quest=https://httpbin.org/anything/post-me'

If you can only send a GET, name the method in the query, before the address:
    curl 'https://www.codetabs.org/v1/proxy?method=POST&quest=https://httpbin.org/anything/post-me'

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

httpbin.org 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.

Try it

Address:

Notes

FIXME somebody who knows should write down which machine this runs on now.
  • No key. Please do not ask for one.
  • Answers over 5 MB are cut off.
  • If it is down, say so on the list and wait.
services/corsproxy.txt · Last modified: 2021/02/14 19:03 by admin
Except where otherwise noted, content on this wiki is in the public domain. codetabs.org