Proxy a GET request with proof generation
curl --request GET \
--url http://localhost:8080/proxy \
--header 'T-PROXY-URL: <t-proxy-url>' \
--header 'T-REQUEST-ID: <t-request-id>'import requests
url = "http://localhost:8080/proxy"
headers = {
"T-PROXY-URL": "<t-proxy-url>",
"T-REQUEST-ID": "<t-request-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'T-PROXY-URL': '<t-proxy-url>', 'T-REQUEST-ID': '<t-request-id>'}
};
fetch('http://localhost:8080/proxy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/proxy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"T-PROXY-URL: <t-proxy-url>",
"T-REQUEST-ID: <t-request-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/proxy"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("T-PROXY-URL", "<t-proxy-url>")
req.Header.Add("T-REQUEST-ID", "<t-request-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/proxy")
.header("T-PROXY-URL", "<t-proxy-url>")
.header("T-REQUEST-ID", "<t-request-id>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/proxy")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["T-PROXY-URL"] = '<t-proxy-url>'
request["T-REQUEST-ID"] = '<t-request-id>'
response = http.request(request)
puts response.read_body{}Endpoints
ANY /proxy
Technically, any HTTP method can be used, but the most common use cases are GET and POST. Forwards a GET request to a target URL and generates proofs
GET
/
proxy
Proxy a GET request with proof generation
curl --request GET \
--url http://localhost:8080/proxy \
--header 'T-PROXY-URL: <t-proxy-url>' \
--header 'T-REQUEST-ID: <t-request-id>'import requests
url = "http://localhost:8080/proxy"
headers = {
"T-PROXY-URL": "<t-proxy-url>",
"T-REQUEST-ID": "<t-request-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'T-PROXY-URL': '<t-proxy-url>', 'T-REQUEST-ID': '<t-request-id>'}
};
fetch('http://localhost:8080/proxy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/proxy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"T-PROXY-URL: <t-proxy-url>",
"T-REQUEST-ID: <t-request-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/proxy"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("T-PROXY-URL", "<t-proxy-url>")
req.Header.Add("T-REQUEST-ID", "<t-request-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/proxy")
.header("T-PROXY-URL", "<t-proxy-url>")
.header("T-REQUEST-ID", "<t-request-id>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/proxy")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["T-PROXY-URL"] = '<t-proxy-url>'
request["T-REQUEST-ID"] = '<t-request-id>'
response = http.request(request)
puts response.read_body{}Headers
Target URL to proxy the request to
Unique identifier for the proof request
Comma-separated list of fields to redact in format [req|res]:[body|header]:[field_name]
If present, proof generation will continue even for failed requests (status >= 400)
Response
200 - application/json
Successful response from proxied endpoint with proof generation initiated
The response is of type object.

