Skip to main content

Get Started in 5 Minutes

A lightning‑fast guide to protect your first endpoint with RLaaS.


1 · Sign In

Home Page


  1. Open rlaas.tech
  2. Click Continue with Google – your workspace is created in seconds.

2 · Create a Project & Copy the API Key

Dashboard Page


  • Dashboard → Create New Project → Name it → Save
  • Copy the generated API Key and export it as an env‑var:
  • Click the view rules button and open the rule-management page per project

Rule Page


shell
export RLAAS_API_KEY="<your‑key‑here>"

3 · Add Your First Rule

Add Rule Form


FieldExampleDescription
Endpoint/loginPath you want to protect
Strategyslidingfixed • sliding • token • leaky
Key Byipip or api_key
Limit10Max requests allowed
Window60sSliding/fixed window length

4 · Call the /check Endpoint

main.go
// tiny-login-test.go
// Minimal Go test server that rate-limits /login via RLaaS.
package main

import (
"bytes"
"encoding/json"
"io"
"log"
"net"
"net/http"
)

const rlaasURL = "https://api.rlaas.tech/check"
const apiKey = "<YOUR_API_KEY>" // ← paste your key

type payload struct {
APIKey string `json:"api_key"`
Endpoint string `json:"endpoint"`
Key string `json:"key"`
}

func main() {
http.HandleFunc("/login", func(w http.ResponseWriter, r *http.Request) {
// extract remote IP (no proxy handling here)
clientIP, _, _ := net.SplitHostPort(r.RemoteAddr)

// build RLaaS request payload
body, _ := json.Marshal(payload{
APIKey: apiKey,
Endpoint: "/login",
Key: clientIP,
})

// ask RLaaS if this hit is allowed
resp, err := http.Post(rlaasURL, "application/json", bytes.NewReader(body))
if err != nil {
http.Error(w, "RLaaS check failed: "+err.Error(), http.StatusBadGateway)
return
}
defer resp.Body.Close()

// proxy RLaaS response & status code back to caller
w.WriteHeader(resp.StatusCode)
io.Copy(w, resp.Body)
})

log.Println("⇢ http://localhost:8080/login")
log.Fatal(http.ListenAndServe(":8080", nil))
}

RLaaS responses are minimal and designed for fast decision-making:

  • On success, the server responds with JSON: { "allowed": true }
  • On failure (e.g. limit exceeded), the server returns plain text: Rate limit exceeded

Note: You should treat any non-allowed: true response as a rejection.
This includes checking the status code (e.g. 429) or falling back when the response is not JSON.

⚙️ In production, it’s recommended to handle both cases explicitly —
parse and act on allowed: true, and treat everything else as a denial to ensure consistent throttling behavior.