The proxy module is designed as a simple proxy and cache node for Embloy Quicklink. It can be used to integrate Embloy without using a Server-SDK or embedding any code on a third party site, allowing the third party to simple direct to a generic URL which then proxies the Quicklink request by fetching a Request and Client token remotely. The architecture might look like this:
┌─────────┐
┌───────────────────────┐ ┌─► │ Proxy 1 ├──┐ ┌────────┐
│ ├─────────────────────┘ └─────────┘ └─►│ │/sdk/request/auth/token
│ Third party service │GET apply.embloy.com │ GO SDK │ ┌──────────┐
│ (DNS-RR/HTTP 302) │GET apply.embloy.com │ │────────►│ Core-API │
│ ├─────────────────────┐ ┌─────────┐ ┌─►└────────┘ └──────────┘
└───────────────────────┘ └─► │ Proxy 2 ├──┘
└─────────┘
The following configuration options are available via environment variables:
ADMIN_TOKEN
: Can be used to authenticate for client tokens. No default value set.MAIN_INSTANCE
: The url of the main Embloy website. Used to redirect user. No default value set.GIN_MODE
: The mode in which Gin runs. Can bedebug
,release
, ortest
. Defaults todebug
.LOG_DIR
: The directory where logs are stored. Defaults tovar/log/embloy-proxy
.LOG_LEVEL
: The level of logging. Can bedebug
,info
,warn
,error
,fatal
, orpanic
. Defaults toinfo
.
To start the proxy service, simply run:
go run cmd/proxy/proxy.go