Skip to content
LR Defender
Book a demo

Proxy integrations

The forwarding rule from Proxy setup, in the configuration each platform already uses. Nothing to install: every example is the platform's own feature.

Before you start

Read Proxy setup first. Every example below does the same thing: it forwards each path under /collect/ on your host to https://api.lrdefender.lightningresearch.ai, with the method, body and headers unchanged. Then pass your host as the SDK's endpoint.

Cloudflare Workers

Create a Worker with the code below and add a route for app.example.com/collect/* on your zone.

// Route app.example.com/collect/* to this Worker.export default {  async fetch(request) {    const url = new URL(request.url);    const upstream = new URL(url.pathname + url.search, "https://api.lrdefender.lightningresearch.ai");    // Same method, headers (Origin and Authorization included) and body.    return fetch(new Request(upstream, request));  },};

Vercel

An external rewrite in vercel.json forwards the path from any Vercel project.

{  "rewrites": [    { "source": "/collect/:path*", "destination": "https://api.lrdefender.lightningresearch.ai/collect/:path*" }  ]}

Next.js

On a Next.js app you host yourself, the same rewrite goes in next.config.ts.

import type { NextConfig } from "next"; const nextConfig: NextConfig = {  async rewrites() {    return [      { source: "/collect/:path*", destination: "https://api.lrdefender.lightningresearch.ai/collect/:path*" },    ];  },}; export default nextConfig;

Netlify

A rewrite with status 200 in _redirects proxies the path instead of redirecting the browser.

/collect/*  https://api.lrdefender.lightningresearch.ai/collect/:splat  200

Amazon CloudFront

  1. Add an origin for api.lrdefender.lightningresearch.ai, over HTTPS only.
  2. Add a behavior for the path pattern /collect/* that uses this origin and allows every HTTP method.
  3. Give it the managed cache policy CachingDisabled and the managed origin request policy AllViewerExceptHostHeader, so the Origin and Authorization headers reach us unchanged.

Get a verdict in your own app.

After a demo call, we set up your account and email you a link to set your password. It starts with a 90-day free trial on the Pro plan's limits, with no card.