Skip to content

Welcome to Binary Vigil Docs

BinaryVigil is a powerful tool designed to protect your applications from abuse by providing robust rate limiting capabilities. It acts as a gateway, sitting in front of your application and intelligently managing incoming requests.

Benefits of using Binary Vigil:

  • Rate Limiting: Protect your servers from being overwhelmed by excessive requests, ensuring availability and stability. Also reduces resource usage on your backend.
  • Cost-Effective: Rate limited requests are handled at no charge.
  • Cheap: Very cheap to run.
  • Easy Integration: Simple to set up and easy to use.

How to Use Binary Vigil

Get started with Binary Vigil in a few easy steps:

  1. Create a Host: From binaryvigil.xyz create a new host.

    Create Host

  2. Copy Host ID: After creating the host, go back and click on the three dots to reveal a menu, then select "Copy Host ID".

    Copy Host ID

  3. Use Host ID in Header: When making requests to your application through the binaryvigil gateway, include the X-Host-Id header with the copied Host ID. This header is essential for routing your traffic through Binary Vigil and applying the configured rate limiting rules.

    Send your requests to gateway.binaryvigil.xyz, including the X-Host-Id header. The path and query parameters can be anything you need for your application.

    Example Requests:

    Using curl:

    curl -H "X-Host-Id: YOUR_HOST_ID" https://gateway.binaryvigil.xyz/your/application/path?param1=value1&param2=value2
    

    Using fetch in JavaScript:

    fetch('https://gateway.binaryvigil.xyz/your/application/path?param1=value1&param2=value2', {
      headers: {
        'X-Host-Id': 'YOUR_HOST_ID'
      }
    })
    .then(response => {
      // Handle the response
    });
    

    This header tells binaryvigil which host configuration to apply to the incoming request, ensuring the correct rate limiting rules are enforced.

    Rate Limited Response:

    When a request is rate limited, binaryvigil gateway will return a 200 status code with the following JSON body:

    {
      "status": "ratelimited",
      "code": 429,
      "message": "Too many requests, slow down."
    }