Skip to content

Universal CORS proxy for developers. Zero-config, secure, and lightning-fast. Bypass CORS restrictions instantly.

License

Notifications You must be signed in to change notification settings

iambhvsh/blkproxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ blkproxy - The Developer's CORS Proxy

Bypass CORS. Build Faster.

blkproxy is a free, zero-config CORS proxy designed for developers who need to instantly access any API during development and testing, without cross-origin restrictions. Built on Vercel's global edge network for maximum performance and reliability.

Deploy with Vercel MIT License Status


✨ Features

  • πŸ”₯ Zero Configuration - No API keys, no sign-ups, no complex setup
  • ⚑ Lightning Fast - Powered by Vercel's Edge Network for global low latency
  • πŸ›‘οΈ Secure by Default - Built-in SSRF protection and security headers
  • πŸ”„ Auto-Retry - Intelligent retry mechanism for transient network errors
  • πŸ“± Universal Support - Works with any HTTP method, headers, and request body
  • 🌍 Global Scale - Infinitely scalable, stateless architecture
  • 🚫 No Rate Limits - Unlimited requests for development and testing
  • πŸ”’ Privacy Focused - We don't log your request/response data

πŸš€ Quick Start

Option 1: Use Our Public Instance 🌐

Simply prepend our URL to your target API endpoint:

const targetUrl = 'https://api.example.com/data';
const proxyUrl = `https://blkproxy.vercel.app/api/proxy?url=${encodeURIComponent(targetUrl)}`;

fetch(proxyUrl)
  .then(response => response.json())
  .then(data => console.log('βœ… Success:', data))
  .catch(error => console.error('❌ Error:', error));

Option 2: Deploy Your Own Instance πŸ› οΈ

1-Click Deploy to Vercel:

Deploy with Vercel

Or manually:

# Clone the repository
git clone https://github.com/iambhvsh/blkproxy.git
cd blkproxy

# Deploy with Vercel CLI
npx vercel

That's it! Your personal CORS proxy is live in seconds. πŸŽ‰


πŸ“– Usage Examples

Basic GET Request

const response = await fetch('https://blkproxy.vercel.app/api/proxy?url=https://jsonplaceholder.typicode.com/posts/1');
const data = await response.json();
console.log(data);

POST Request with JSON Body

const targetUrl = 'https://api.example.com/users';
const proxyUrl = `https://blkproxy.vercel.app/api/proxy?url=${encodeURIComponent(targetUrl)}`;

fetch(proxyUrl, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your-token'
  },
  body: JSON.stringify({
    name: 'John Doe',
    email: '[email protected]'
  })
})
.then(response => response.json())
.then(data => console.log('βœ… User created:', data));

Using with Axios

import axios from 'axios';

const targetUrl = 'https://api.example.com/data';
const proxyUrl = `https://blkproxy.vercel.app/api/proxy?url=${encodeURIComponent(targetUrl)}`;

const response = await axios.get(proxyUrl);
console.log(response.data);

React Hook Example

import { useState, useEffect } from 'react';

function useProxyFetch(url) {
  const [data, setData] = useState(null);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState(null);

  useEffect(() => {
    const proxyUrl = `https://blkproxy.vercel.app/api/proxy?url=${encodeURIComponent(url)}`;
    
    fetch(proxyUrl)
      .then(response => response.json())
      .then(data => {
        setData(data);
        setLoading(false);
      })
      .catch(err => {
        setError(err);
        setLoading(false);
      });
  }, [url]);

  return { data, loading, error };
}

// Usage in component
function MyComponent() {
  const { data, loading, error } = useProxyFetch('https://api.example.com/data');
  
  if (loading) return <div>Loading...</div>;
  if (error) return <div>Error: {error.message}</div>;
  
  return <div>{JSON.stringify(data, null, 2)}</div>;
}

πŸ”’ Security Features

πŸ›‘οΈ SSRF Protection

blkproxy includes robust protection against Server-Side Request Forgery attacks:

  • βœ… Only http:// and https:// protocols allowed
  • βœ… Blocks requests to localhost and private IP addresses
  • βœ… Validates URL format before processing
  • βœ… Optional hostname whitelist for production use

πŸ” Production Whitelist

For enhanced security in production environments, you can restrict access to specific domains:

Environment Variable: ALLOWED_HOSTS
Format: Comma-separated list of allowed hostnames

# Example in Vercel environment variables
ALLOWED_HOSTS=api.github.com,api.stripe.com,jsonplaceholder.typicode.com

When configured, only requests to whitelisted domains will be processed.

πŸ₯ Security Headers

All responses include comprehensive security headers:

  • Content-Security-Policy: default-src 'none'; frame-ancestors 'none';
  • X-Content-Type-Options: nosniff
  • X-Frame-Options: DENY
  • Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
  • Referrer-Policy: no-referrer
  • Access-Control-Allow-Origin: *

πŸ“Š API Reference

Proxy Endpoint

URL: GET/POST/PUT/PATCH/DELETE /api

Query Parameters:

  • url (required) - The target URL to proxy the request to

Example:

https://blkproxy.vercel.app/api/proxy?url=https://api.example.com/users

Health Check

URL: GET /api/health

Response:

{
  "status": "ok",
  "message": "blkproxy is operational",
  "timestamp": "2025-01-20T10:30:00.000Z"
}

🎯 Use Cases

πŸ§ͺ Development & Testing

  • Bypass CORS during local development
  • Test third-party APIs from browser applications
  • Prototype with external services quickly

πŸ” API Exploration

  • Explore public APIs from browser dev tools
  • Build interactive API documentation
  • Create API testing interfaces

πŸ“± Client-Side Applications

  • Access APIs from static sites
  • Build serverless frontend applications
  • Create browser extensions that need API access

πŸŽ“ Learning & Education

  • Educational projects and tutorials
  • API integration workshops
  • Demonstrate web technologies

βš–οΈ Fair Use Policy

blkproxy is built for the developer community with trust and transparency:

βœ… Appropriate Use

  • πŸ› οΈ Development & Testing - Perfect for local development and testing
  • πŸŽ“ Educational Projects - Great for learning and tutorials
  • πŸ” API Exploration - Ideal for testing public APIs
  • πŸ“± Prototyping - Excellent for quick prototypes and demos

❌ Prohibited Use

  • 🚫 Production Applications - Not intended for production traffic
  • 🚫 High-Volume Scraping - Respect rate limits of target APIs
  • 🚫 Illegal Activities - No malicious or illegal usage
  • 🚫 Commercial Abuse - Don't use for large-scale commercial operations

πŸ” Privacy Commitment

  • We don't log request or response bodies
  • Your data simply passes through the proxy
  • No tracking, no analytics on your API calls
  • Respect for your privacy is paramount

🌐 Browser Compatibility

blkproxy works seamlessly across all modern browsers:

  • βœ… Chrome (Latest)
  • βœ… Firefox (Latest)
  • βœ… Safari (Latest)
  • βœ… Edge (Latest)
  • βœ… Opera (Latest)
  • βœ… Mobile Browsers (iOS Safari, Chrome Mobile)

πŸ“ Local Development Notes

When testing locally, serve your HTML files from a local server instead of opening directly in the browser:

# Using Python
python3 -m http.server 8000

# Using Node.js
npx serve

# Using PHP
php -S localhost:8000

🀝 Contributing

We welcome contributions from the community! Here's how you can help:

πŸ› Bug Reports

Found a bug? Open an issue with:

  • Clear description of the problem
  • Steps to reproduce
  • Expected vs actual behavior
  • Browser and environment details

πŸ’‘ Feature Requests

Have an idea? Start a discussion about:

  • What problem it solves
  • Proposed implementation
  • Use cases and examples

πŸ”§ Code Contributions

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests if applicable
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

πŸ“ˆ Status & Monitoring

πŸ” Real-time Status

Check the current status of blkproxy:

πŸ“Š Performance

  • Global Edge Network: Sub-100ms response times worldwide
  • 99.9% Uptime: Backed by Vercel's infrastructure reliability
  • Auto-scaling: Handles traffic spikes automatically

πŸ› οΈ Technical Details

Architecture

  • Runtime: Vercel Edge Runtime
  • Language: JavaScript/TypeScript
  • Deployment: Vercel Edge Functions
  • Network: Global CDN distribution

Configuration Options

// Available in the source code
const RETRY_COUNT = 3;                    // Number of retry attempts
const RETRY_DELAY_MS = 200;               // Base retry delay
const ALLOWED_HOSTS_ENV = process.env.ALLOWED_HOSTS; // Whitelist configuration

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘€ Author

Made with ❀️ by iambhvsh


⭐ Support the Project

If blkproxy helps you in your development journey:

  • ⭐ Star this repository to show your support
  • πŸ› Report bugs to help us improve
  • πŸ’‘ Suggest features for future enhancements
  • πŸ“’ Share with fellow developers who might find it useful

πŸš€ Ready to bypass CORS and build faster?

Deploy Now

Visit blkproxy.vercel.app to get started!


Built for developers, by developers. Happy coding! πŸŽ‰

About

Universal CORS proxy for developers. Zero-config, secure, and lightning-fast. Bypass CORS restrictions instantly.

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •