Proxy for all traffic
Rek.ai supports a full proxy setup for all traffic between your website and our services.
Instead of the visitor's browser communicating directly with Rek.ai, all requests first pass through an endpoint hosted on your own server. This endpoint receives each GET and POST request and forwards it securely to Rek.ai, then returns the response back to the website.
This architecture means Rek.ai only receives traffic from your server environment. We do not receive or process the end user's IP address, since all communication appears to come from a single controlled source.
Benefits include:
- No direct browser connection to Rek.ai
- End user IP addresses are never exposed to Rek.ai
- All traffic routed through your own infrastructure
- Centralized control, logging, and filtering of requests
- Full ability to inspect, control, remove, or update individual request parameters before forwarding traffic to Rek.ai
Setup in the proxy
The proxy code running on your server should determine whether the incoming request is a GET or POST request. If it's a GET request, forward it as a GET request to https://predict.rekai.se/predict (opens in a new tab). If it's a POST request, forward it as a POST request to https://view.rekai.se/view (opens in a new tab).
Depending on your server environment and outbound firewall rules, you may need to allow connections from your server to our hosts. Send us an email at info@rek.ai (opens in a new tab).
Full control of request parameters before forwarding
Both GET and POST requests can be unpacked and inspected on your server before they are forwarded to Rek.ai. This makes it possible to override, remove, validate, or update individual parameters in the request payload or query string before the traffic is sent to our backend. In practice, this gives you full control over what data is forwarded and lets you enforce internal rules, privacy requirements, or custom business logic within your own infrastructure.
Forward responses directly to the frontend
Responses returned from Rek.ai to your proxy can normally be passed directly back to the frontend without being unpacked, modified, or transformed. Your proxy simply acts as an intermediary layer that receives the response from Rek.ai and returns it to the browser. This keeps the implementation simple while still giving you full control over inbound traffic and network routing.
Set up the proxy addresses on each page
To start using a proxy, enter the addresses in an object on each page:
<script>
window.rek_customsettings = window.rek_customsettings || {};
window.rek_customsettings.proxypredict = '/rest-api/rekproxy/';
window.rek_customsettings.proxyview = '/rest-api/rekproxy/';
</script>