A simple, lightweight HTTP proxy to allow anyone to access cloud run endpoints behind authentication. This will proxy
requests to the cloud run endpoint, and add the Authorization header to the request based on your credentials.
You need to ensure that you are logged in to your Google account before using Proximo.
gcloud auth loginStart with a single target
proximo -targets service=https://my-cloud-run-endpoint.run.appThis will start the proxy on port 8080, proxying requests to the given Cloud Run URL and adding the Authorization header with your Google credentials. You should be able to access the endpoint at http://localhost:8080.
Start with multiple targets
proximo -targets service1=https://service1.com,service2=https://service2.comThis will start the proxy on port 8080, proxying requests to the given Cloud Run URLs and adding the Authorization header with your Google credentials. You should be able to access the endpoints at http://localhost:8080.
Start with config file
proximo -file config.yamlThis will start the proxy on port 8080, proxying requests to the given Cloud Run URLs and adding the Authorization header with your Google credentials. You should be able to access the endpoints at http://localhost:8080. This will use a config file to specify target and url mappings.
{
"targets": {
"google": "https://google.com",
"microsoft": "https://microsoft.com"
}
}Change the port of the proxy
proximo -targets service=https://my-cloud-run-endpoint.run.app -port 4040Disable the JWT token
proximo -config config.json -auth=falseProximo supports routing requests to multiple backends based on the Host header. You can specify multiple host-to-target mappings when starting the proxy using the -targets or -file flag.
proximo -targets="search=https://search.com,api=https://api.com"This will create reverse proxies for `search.com` and `api.com`, respectively. You can then send requests to these backends using the appropriate `Host` header:
# For https://search.com
curl -H "Host: search" http://localhost:8080/path/to/resource
# For https://api.com
curl -H "Host: api" http://localhost:8080/api/v1/endpointProximo automatically adds an `Authorization` header with a JWT token to the forwarded requests. The token is obtained from the default Google Cloud Platform credentials on your machine.
To ensure that the proxy can authenticate with your Google account, you need to be logged in:
gcloud auth loginThe proxy will use the credentials from your currently authenticated Google account to generate the JWT token.
It should be easy to build Proximo from source:
makeThis will build the proximo binary and output it to the ./builds directory based on the arch you build it in.