Introducing proxy-app, a lightweight proxy for exposing endpoints that require authentication.
Now that we support ElasticSearch, we needed a way to expose its private endpoint to external applications whilst providing a layer of authorisation right from your Skpr project.
Why use this in your project?
If you've got a private endpoint in your project and wish to expose it publicly in a controlled way, you're in luck. The Skpr proxy app will allow for external apps to access the private endpoint in a public location which can be consumed by other applications - such as a Solr index, an ElasticSearch instance etc. Control mechanisms are currently limited to HTTP Basic authentication and any applicable routing rules in your project's settings.
The proxy app is easily configurable via the skpr
command-line tool, so managing the app is as easy as other Skpr apps.
How can I use it?
Let's look at how two ways of using this proxy can assist:
Docker
$ docker run --rm \
-p 7000:7000 \
-e PROXY_APP_ADDR=:7000 \
-e PROXY_APP_ENDPOINT=https://www.skpr.com.au \
-e PROXY_APP_USERNAME=""
-e PROXY_APP_PASSWORD= ""
--name skpr-proxy \
skpr/proxy-app
$ curl -Isl http://localhost:7000 -H "Host: www.skpr.com.au" | grep HTTP
HTTP/1.1 200 OK
Docker compose
services:
proxy:
image: skpr/proxy-app
environment:
- "PROXY_APP_ADDR=:30881"
- "PROXY_APP_ENDPOINT=https://www.skpr.com.au"
- "PROXY_APP_USERNAME=''"
- "PROXY_APP_PASSWORD= ""
ports:
- 30881:30881
See it in action
$ docker-compose run cli
Creating project_cli ... done
root@9e0a67879b16:/app# curl --HEAD proxy:30881 -H "Host: www.skpr.com.au" | grep HTTP
HTTP/1.1 200 OK
What's next?
Any OCI-compliant container-based solution will be able to support our proxy.
It's pretty exciting to have a proxy to tunnel traffic from multiple external endpoints to a centralized service such as search, content or something else completely.
We feel this solution would help provide customers keep control and security over their applications whilst allowing for decoupled and other interesting application architectures.
Do you have any architectural challenges you're facing? Could this new capability bring some exciting functionality to your application? We'd love to hear from you.