What are Clients?
A client in KnoxCall is an authorized IP address or network that’s allowed to make requests through your routes. Think of clients as your “guest list” for API access.The Bouncer Analogy
Imagine KnoxCall as a nightclub bouncer:- Without clients: Anyone on the internet can try to access your routes
- With clients: Only IPs on your whitelist get through the door
What Problem Do Clients Solve?
The Problem: Open Access
Without client authorization, your KnoxCall routes are accessible to anyone who knows the URL:- Attackers can spam your routes
- Unexpected traffic costs
- Potential DDoS attacks
- Unauthorized access attempts
The Solution: IP Whitelisting
With client authorization enabled, only specific IP addresses can access your routes:How Client Authorization Works
The Request Flow
Example
Your clients:- Production server:
52.123.45.67 - Staging server:
54.200.11.22
Client Types
KnoxCall supports three types of clients:1. Server (Recommended for Production)
Best for: Production servers with static IPs Characteristics:- Fixed IP address (e.g., AWS Elastic IP)
- Never changes
- Most reliable authorization method
2. User (For Development)
Best for: Developer machines, dynamic IPs Characteristics:- IP may change occasionally
- Great for local development
- Can be updated when IP changes
3. Network (For IP Ranges)
Best for: Office networks, VPNs, cloud providers Characteristics:- Covers entire IP range using CIDR notation
- All IPs in range are authorized
- Convenient for large teams
IP Address Formats
Single IP Address
Most common format for individual servers:CIDR Notation (IP Ranges)
For networks and ranges:/24 mean?
- Authorizes 192.168.1.0 through 192.168.1.255
- That’s 256 IP addresses
/32= 1 IP (e.g., 192.168.1.1/32)/24= 256 IPs (e.g., 192.168.1.0/24)/16= 65,536 IPs (e.g., 10.0.0.0/16)
- 203.14.0.1
- 203.14.0.2
- … (all IPs from 203.14.0.0 to 203.14.255.255)
Per-Environment Client Authorization
One of KnoxCall’s most powerful features: different clients for different environments.The Concept
You can assign different sets of clients to:- Production environment
- Staging environment
- Development environment
Real-World Example
Route:user-api
Production environment clients:
52.123.45.67(prod server)52.123.45.68(prod server backup)
54.200.11.22(staging server)203.45.67.89(your dev laptop)
- Production traffic comes from prod IPs only
- Staging can be accessed from staging server AND your laptop
- Clear separation between environments
Common Use Cases
1. Production API Server
Scenario: Your backend server needs to call third-party APIs Setup:2. Office Network
Scenario: Multiple team members need to test webhooks Setup:3. Partner Integration
Scenario: External partner needs to send webhooks to your system Setup:4. Development Team
Scenario: 5 developers working remotely with dynamic IPs Option A: Individual clients (tedious)- Create test API key with
skip_ip_check: true - Developers use API key instead of IP whitelist
- More flexible for dynamic IPs
Client Priority and Fallback
Assignment Levels
Clients can be assigned at two levels:- Route-level (global): All environments use these clients
- Environment-level: Specific clients per environment
- Production: Only
prod-serverallowed - Staging:
staging-serveranddev-laptopallowed - Global clients ignored when environment has specific clients
Security Best Practices
✅ Do
- Use specific IPs - Don’t whitelist entire internet ranges
- Use CIDR for networks - Easier to manage office networks
- Separate environments - Different clients for prod/staging/dev
- Use descriptive names -
prod-api-server-1notserver1 - Document why - Add descriptions explaining each client’s purpose
- Regular audits - Remove unused clients monthly
❌ Don’t
- Don’t use 0.0.0.0/0 - This allows ALL IPs (defeats the purpose!)
- Don’t reuse clients - Production and staging should have separate clients
- Don’t forget to update - When IPs change, update immediately
- Don’t whitelist untrusted IPs - Only authorize systems you control
- Don’t use generic names -
client1,client2are unmaintainable
IP Detection
KnoxCall automatically detects the source IP from these headers (in order):- cf-connecting-ip (Cloudflare - most reliable)
- x-forwarded-for (Standard proxy header - first IP only)
- Socket remote address (Direct connection fallback)
When NOT to Use Clients
Client authorization might not be necessary if:- Public webhooks - Stripe, Shopify send from many IPs (use signature validation instead)
- CDN origins - Cloudflare, Fastly have changing IP ranges (use request signing)
- Mobile apps - Users have random IPs (use API key auth)
- Serverless functions - Lambda, Cloud Functions have dynamic IPs (use API keys)
x-knoxcall-signature) for these scenarios.
Quick Reference
| Client Type | Best For | Example IP | Format |
|---|---|---|---|
| Server | Production servers | 52.123.45.67 | Single IP |
| User | Developer machines | 203.45.67.89 | Single IP |
| Network | Office networks, VPNs | 192.168.1.0/24 | CIDR range |
Next Steps
Create Your First Client
Step-by-step tutorial
Managing Clients
Create, edit, delete, and assign clients
Client Types
Deep dive into Server, User, and Network types
CIDR Notation
Understanding IP ranges
Key Takeaway: Clients are your first line of defense. They provide network-level security by ensuring only authorized IPs can access your routes.