Proxy with content replacement
This is an HTTP proxy that not only rewrites the request but also replaces URIs
in the HTTP response body to expose the URI-namespace served by the proxy.
The motivating use-case for this proxy is to allow a Trifid-LD
to be accessible on a host that doesn't match the authority section of the URIs
in the graph exposed by Trifid-LD.
For example is you have Trifid-LD exposing a dataset with IRIs in the
namespace but want to have them accessible on
localhost you could use
content-replace-proxy with the following configuration (assuming the Trifid-LD
instances listens to port 8080):
docker build -t crproxy .
config.js file in the current working directory you can start it as follows:
docker run --rm -v `pwd`/config.js:/usr/src/app/config.js crproxy
A pre-built version is available on the Docker Hub Repositories as
zazukoians/content-replace-proxy. It is recommended to use this image as
base image for custom configurations.