QuotaGuard and Emergent Integration Guide

    QuotaGuard and Emergent Integration Guide

    QuotaGuard Static IPs allow your Emergent applications to send outbound traffic through a load-balanced pair of static IP addresses. Once set up, you can use QuotaGuard’s IPs to connect to firewalled databases and APIs that require IP allowlisting.

    This guide covers both deployment paths: Emergent-hosted apps and apps exported to GitHub for self-hosting on Vercel, Render, Fly.io, AWS, or other platforms.

    Why Emergent Apps Need Static IPs

    Emergent.sh turns natural language prompts into production-ready applications, but those apps inherit the dynamic IP behavior of cloud infrastructure. Whether hosted on Emergent’s managed platform or exported and self-hosted, your app’s outbound traffic originates from shared, rotating IP pools.

    Common scenarios where you need a static IP:

    • MongoDB Atlas: Requires IP allowlisting in Network Access settings
    • Payment Gateways: Stripe Connect, Adyen, and banking APIs that only accept requests from registered IPs
    • Amazon RDS: Security groups with IP-based rules
    • Partner APIs: Corporate firewalls that require known source addresses
    • Government Systems: Agencies and healthcare providers with strict IP policies
    • Legacy ERPs: On-premise SAP, Oracle, and mainframe systems with firewall restrictions

    The result is connection failures and blocked requests that have nothing to do with your code. Your credentials are valid. Your application logic is correct. The external service is simply blocking requests from unknown cloud IP addresses.

    QuotaGuard gives your Emergent applications a fixed, verifiable identity that partners can add to their firewall allowlists once.

    Two Deployment Paths

    Emergent supports two ways to run your apps:

    PathHow It WorksStatic IP Solution
    Emergent-hostedDeploy directly on Emergent’s managed infrastructureConfigure proxy in application code
    ExportedExport to GitHub, deploy on Vercel, Render, Fly.io, AWS, etc.Configure proxy in code + set environment variable on hosting platform

    Both paths use the same code-level proxy configuration. The only difference is where you set the QUOTAGUARDSTATIC_URL environment variable.

    Getting Started

    After creating a QuotaGuard account, you will be redirected to your dashboard where you can find your proxy credentials and static IP addresses.

    Your proxy URL will look like this:

    http://username:password@us-east-static-01.quotaguard.com:9293
    

    Finding Your Static IPs: Your two static IPs are displayed in the QuotaGuard dashboard. Both IPs are active simultaneously for high availability. Add both to any firewall allowlists you configure on the target service side.

    Choose the right proxy region: Match your QuotaGuard region to minimize latency.

    Deployment RegionRecommended QuotaGuard Region
    US (default)US-East
    US WestUS-West
    CanadaCanada (Montreal)
    EuropeEU-West (Ireland) or EU-Central (Frankfurt)
    Asia PacificAP-Northeast (Tokyo) or AP-Southeast (Singapore)
    AustraliaAustralia (Sydney)
    South AmericaSouth America (Sao Paulo)

    Configuring Your Emergent Application

    Step 1: Set the Environment Variable

    For Emergent-hosted apps: Check Emergent’s documentation for how to set environment variables. Most platforms provide this through a settings panel or configuration file.

    For exported apps on Vercel:

    vercel env add QUOTAGUARDSTATIC_URL
    # Enter: http://username:password@us-east-static-01.quotaguard.com:9293
    

    Or add to your Vercel project settings in the dashboard under Environment Variables.

    For exported apps on Render:

    Add the variable in your service’s Environment settings in the Render dashboard.

    For exported apps on Fly.io:

    fly secrets set QUOTAGUARDSTATIC_URL="http://username:password@us-east-static-01.quotaguard.com:9293"
    

    For exported apps on AWS (Lambda/ECS):

    Set the environment variable in your Lambda configuration or ECS task definition.

    Step 2: Configure Your Application Code

    Emergent typically generates Node.js or Python backends. Configure the proxy in your HTTP client.


    Node.js

    Install the proxy agent:

    npm install https-proxy-agent
    

    With Axios

    const axios = require('axios');
    const { HttpsProxyAgent } = require('https-proxy-agent');
    
    const proxyUrl = process.env.QUOTAGUARDSTATIC_URL;
    const agent = new HttpsProxyAgent(proxyUrl);
    
    async function callProtectedAPI(url, data) {
        const response = await axios.post(url, data, {
            httpsAgent: agent
        });
        return response.data;
    }
    
    // Example: payment API that requires IP whitelisting
    async function processPayment(paymentDetails) {
        return await callProtectedAPI(
            'https://api.paymentprovider.com/v1/charge',
            paymentDetails
        );
    }
    

    With Native Fetch (Undici)

    import { ProxyAgent, fetch } from 'undici';
    
    const proxyUrl = process.env.QUOTAGUARDSTATIC_URL;
    const dispatcher = new ProxyAgent(proxyUrl);
    
    async function callProtectedAPI(url, options = {}) {
        const response = await fetch(url, {
            ...options,
            dispatcher
        });
        return response.json();
    }
    

    Install undici:

    npm install undici
    

    With Node-Fetch

    const fetch = require('node-fetch');
    const { HttpsProxyAgent } = require('https-proxy-agent');
    
    const proxyUrl = process.env.QUOTAGUARDSTATIC_URL;
    const agent = new HttpsProxyAgent(proxyUrl);
    
    async function callProtectedAPI(url, options = {}) {
        const response = await fetch(url, { ...options, agent });
        return response.json();
    }
    

    With Got

    const got = require('got');
    const { HttpsProxyAgent } = require('https-proxy-agent');
    
    const proxyUrl = process.env.QUOTAGUARDSTATIC_URL;
    const agent = new HttpsProxyAgent(proxyUrl);
    
    async function callProtectedAPI(url) {
        const response = await got(url, {
            agent: { https: agent }
        });
        return JSON.parse(response.body);
    }
    

    With Superagent

    const superagent = require('superagent');
    require('superagent-proxy')(superagent);
    
    const proxyUrl = process.env.QUOTAGUARDSTATIC_URL;
    
    async function callProtectedAPI(url, data) {
        const response = await superagent
            .post(url)
            .send(data)
            .proxy(proxyUrl);
        return response.body;
    }
    

    Python

    With Requests

    import os
    import requests
    
    proxy_url = os.environ.get('QUOTAGUARDSTATIC_URL')
    
    proxies = {
        'http': proxy_url,
        'https': proxy_url
    }
    
    def call_protected_api(url, data):
        response = requests.post(url, json=data, proxies=proxies)
        return response.json()
    
    # Example: partner API behind corporate firewall
    def sync_inventory(inventory_data):
        return call_protected_api(
            'https://api.partner.com/v2/inventory',
            inventory_data
        )
    

    With HTTPX

    import os
    import httpx
    
    proxy_url = os.environ.get('QUOTAGUARDSTATIC_URL')
    
    def call_protected_api(url, data):
        with httpx.Client(proxy=proxy_url) as client:
            response = client.post(url, json=data)
            return response.json()
    
    # Async version
    async def call_protected_api_async(url, data):
        async with httpx.AsyncClient(proxy=proxy_url) as client:
            response = await client.post(url, json=data)
            return response.json()
    

    With aiohttp (Async)

    import os
    import aiohttp
    
    proxy_url = os.environ.get('QUOTAGUARDSTATIC_URL')
    
    async def call_protected_api(url, data):
        async with aiohttp.ClientSession() as session:
            async with session.post(url, json=data, proxy=proxy_url) as response:
                return await response.json()
    

    With urllib3

    import os
    import urllib3
    import json
    
    proxy_url = os.environ.get('QUOTAGUARDSTATIC_URL')
    http = urllib3.ProxyManager(proxy_url)
    
    def call_protected_api(url, data):
        response = http.request(
            'POST',
            url,
            body=json.dumps(data),
            headers={'Content-Type': 'application/json'}
        )
        return json.loads(response.data.decode('utf-8'))
    

    Ruby

    With Net::HTTP

    require 'net/http'
    require 'uri'
    require 'json'
    
    def call_protected_api(url, data)
      uri = URI.parse(url)
      proxy_uri = URI.parse(ENV['QUOTAGUARDSTATIC_URL'])
    
      http = Net::HTTP.new(
        uri.host,
        uri.port,
        proxy_uri.host,
        proxy_uri.port,
        proxy_uri.user,
        proxy_uri.password
      )
      http.use_ssl = uri.scheme == 'https'
    
      request = Net::HTTP::Post.new(uri.path)
      request['Content-Type'] = 'application/json'
      request.body = data.to_json
    
      response = http.request(request)
      JSON.parse(response.body)
    end
    

    With Faraday

    require 'faraday'
    
    proxy_url = ENV['QUOTAGUARDSTATIC_URL']
    
    conn = Faraday.new(proxy: proxy_url) do |f|
      f.request :json
      f.response :json
    end
    
    response = conn.post('https://api.partner.com/v2/data') do |req|
      req.body = { key: 'value' }
    end
    
    puts response.body
    

    With HTTParty

    require 'httparty'
    
    proxy_uri = URI.parse(ENV['QUOTAGUARDSTATIC_URL'])
    
    response = HTTParty.post(
      'https://api.partner.com/v2/data',
      body: { key: 'value' }.to_json,
      headers: { 'Content-Type' => 'application/json' },
      http_proxyaddr: proxy_uri.host,
      http_proxyport: proxy_uri.port,
      http_proxyuser: proxy_uri.user,
      http_proxypass: proxy_uri.password
    )
    
    puts response.parsed_response
    

    With RestClient

    require 'rest-client'
    
    proxy_url = ENV['QUOTAGUARDSTATIC_URL']
    RestClient.proxy = proxy_url
    
    response = RestClient.post(
      'https://api.partner.com/v2/data',
      { key: 'value' }.to_json,
      { content_type: :json }
    )
    
    puts JSON.parse(response.body)
    

    PHP

    With cURL

    <?php
    
    function callProtectedAPI($url, $data) {
        $proxyUrl = getenv('QUOTAGUARDSTATIC_URL');
        $proxy = parse_url($proxyUrl);
        
        $ch = curl_init();
        
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
        curl_setopt($ch, CURLOPT_PROXY, $proxy['host'] . ':' . $proxy['port']);
        curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxy['user'] . ':' . $proxy['pass']);
        
        $response = curl_exec($ch);
        
        if (curl_errno($ch)) {
            throw new Exception('cURL error: ' . curl_error($ch));
        }
        
        curl_close($ch);
        return json_decode($response, true);
    }
    
    // Example usage
    $result = callProtectedAPI('https://api.partner.com/v2/data', ['key' => 'value']);
    print_r($result);
    

    With Guzzle

    <?php
    
    require 'vendor/autoload.php';
    
    use GuzzleHttp\Client;
    
    $proxyUrl = getenv('QUOTAGUARDSTATIC_URL');
    
    $client = new Client([
        'proxy' => $proxyUrl
    ]);
    
    $response = $client->post('https://api.partner.com/v2/data', [
        'json' => ['key' => 'value']
    ]);
    
    $data = json_decode($response->getBody(), true);
    print_r($data);
    

    With Symfony HttpClient

    <?php
    
    use Symfony\Component\HttpClient\HttpClient;
    
    $proxyUrl = getenv('QUOTAGUARDSTATIC_URL');
    
    $client = HttpClient::create([
        'proxy' => $proxyUrl
    ]);
    
    $response = $client->request('POST', 'https://api.partner.com/v2/data', [
        'json' => ['key' => 'value']
    ]);
    
    $data = $response->toArray();
    print_r($data);
    

    Go

    package main
    
    import (
        "bytes"
        "encoding/json"
        "fmt"
        "io"
        "net/http"
        "net/url"
        "os"
    )
    
    func callProtectedAPI(targetURL string, data map[string]interface{}) (map[string]interface{}, error) {
        proxyURL, err := url.Parse(os.Getenv("QUOTAGUARDSTATIC_URL"))
        if err != nil {
            return nil, err
        }
    
        client := &http.Client{
            Transport: &http.Transport{
                Proxy: http.ProxyURL(proxyURL),
            },
        }
    
        jsonData, err := json.Marshal(data)
        if err != nil {
            return nil, err
        }
    
        resp, err := client.Post(targetURL, "application/json", bytes.NewBuffer(jsonData))
        if err != nil {
            return nil, err
        }
        defer resp.Body.Close()
    
        body, err := io.ReadAll(resp.Body)
        if err != nil {
            return nil, err
        }
    
        var result map[string]interface{}
        json.Unmarshal(body, &result)
        return result, nil
    }
    
    func main() {
        data := map[string]interface{}{"key": "value"}
        result, err := callProtectedAPI("https://api.partner.com/v2/data", data)
        if err != nil {
            panic(err)
        }
        fmt.Println(result)
    }
    

    Java

    With HttpURLConnection

    import java.net.*;
    import java.io.*;
    
    public class ProxiedRequest {
        public static String callProtectedAPI(String targetUrl, String jsonData) throws Exception {
            String proxyUrlStr = System.getenv("QUOTAGUARDSTATIC_URL");
            URL proxyUrl = new URL(proxyUrlStr);
            
            String userInfo = proxyUrl.getUserInfo();
            String user = userInfo.substring(0, userInfo.indexOf(':'));
            String password = userInfo.substring(userInfo.indexOf(':') + 1);
    
            Proxy proxy = new Proxy(Proxy.Type.HTTP, 
                new InetSocketAddress(proxyUrl.getHost(), proxyUrl.getPort()));
    
            Authenticator.setDefault(new Authenticator() {
                @Override
                protected PasswordAuthentication getPasswordAuthentication() {
                    return new PasswordAuthentication(user, password.toCharArray());
                }
            });
    
            URL url = new URL(targetUrl);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection(proxy);
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/json");
            conn.setDoOutput(true);
    
            try (OutputStream os = conn.getOutputStream()) {
                os.write(jsonData.getBytes("UTF-8"));
            }
    
            StringBuilder response = new StringBuilder();
            try (BufferedReader br = new BufferedReader(
                    new InputStreamReader(conn.getInputStream(), "UTF-8"))) {
                String line;
                while ((line = br.readLine()) != null) {
                    response.append(line);
                }
            }
    
            return response.toString();
        }
    }
    

    With OkHttp

    import okhttp3.*;
    import java.net.*;
    
    public class ProxiedOkHttpClient {
        public static OkHttpClient createClient() {
            String proxyUrlStr = System.getenv("QUOTAGUARDSTATIC_URL");
            URL proxyUrl;
            try {
                proxyUrl = new URL(proxyUrlStr);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
    
            String userInfo = proxyUrl.getUserInfo();
            String user = userInfo.substring(0, userInfo.indexOf(':'));
            String password = userInfo.substring(userInfo.indexOf(':') + 1);
    
            Proxy proxy = new Proxy(Proxy.Type.HTTP,
                new InetSocketAddress(proxyUrl.getHost(), proxyUrl.getPort()));
    
            Authenticator proxyAuthenticator = (route, response) -> {
                String credential = Credentials.basic(user, password);
                return response.request().newBuilder()
                    .header("Proxy-Authorization", credential)
                    .build();
            };
    
            return new OkHttpClient.Builder()
                .proxy(proxy)
                .proxyAuthenticator(proxyAuthenticator)
                .build();
        }
    }
    

    With Apache HttpClient

    import org.apache.http.HttpHost;
    import org.apache.http.auth.*;
    import org.apache.http.client.*;
    import org.apache.http.impl.client.*;
    import org.apache.http.client.methods.*;
    import org.apache.http.entity.StringEntity;
    
    public class ProxiedApacheClient {
        public static CloseableHttpClient createClient() {
            String proxyUrlStr = System.getenv("QUOTAGUARDSTATIC_URL");
            java.net.URL proxyUrl;
            try {
                proxyUrl = new java.net.URL(proxyUrlStr);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
    
            String userInfo = proxyUrl.getUserInfo();
            String user = userInfo.substring(0, userInfo.indexOf(':'));
            String password = userInfo.substring(userInfo.indexOf(':') + 1);
    
            HttpHost proxy = new HttpHost(proxyUrl.getHost(), proxyUrl.getPort());
            
            CredentialsProvider credsProvider = new BasicCredentialsProvider();
            credsProvider.setCredentials(
                new AuthScope(proxyUrl.getHost(), proxyUrl.getPort()),
                new UsernamePasswordCredentials(user, password)
            );
    
            return HttpClients.custom()
                .setProxy(proxy)
                .setDefaultCredentialsProvider(credsProvider)
                .build();
        }
    }
    

    C# / .NET

    With HttpClient

    using System;
    using System.Net;
    using System.Net.Http;
    using System.Text;
    using System.Text.Json;
    using System.Threading.Tasks;
    
    public class ProxiedHttpClient
    {
        private static HttpClient CreateProxiedClient()
        {
            var proxyUrl = Environment.GetEnvironmentVariable("QUOTAGUARDSTATIC_URL");
            var proxyUri = new Uri(proxyUrl);
            
            var proxy = new WebProxy(proxyUri.GetLeftPart(UriPartial.Authority))
            {
                Credentials = new NetworkCredential(
                    Uri.UnescapeDataString(proxyUri.UserInfo.Split(':')[0]),
                    Uri.UnescapeDataString(proxyUri.UserInfo.Split(':')[1])
                )
            };
    
            var handler = new HttpClientHandler
            {
                Proxy = proxy,
                UseProxy = true
            };
    
            return new HttpClient(handler);
        }
    
        public static async Task<T> CallProtectedAPI<T>(string url, object data)
        {
            using var client = CreateProxiedClient();
            var json = JsonSerializer.Serialize(data);
            var content = new StringContent(json, Encoding.UTF8, "application/json");
            
            var response = await client.PostAsync(url, content);
            var responseJson = await response.Content.ReadAsStringAsync();
            return JsonSerializer.Deserialize<T>(responseJson);
        }
    }
    

    With RestSharp

    using RestSharp;
    using System;
    using System.Net;
    
    public class ProxiedRestClient
    {
        public static RestClient CreateClient(string baseUrl)
        {
            var proxyUrl = Environment.GetEnvironmentVariable("QUOTAGUARDSTATIC_URL");
            var proxyUri = new Uri(proxyUrl);
            
            var options = new RestClientOptions(baseUrl)
            {
                Proxy = new WebProxy(proxyUri.GetLeftPart(UriPartial.Authority))
                {
                    Credentials = new NetworkCredential(
                        Uri.UnescapeDataString(proxyUri.UserInfo.Split(':')[0]),
                        Uri.UnescapeDataString(proxyUri.UserInfo.Split(':')[1])
                    )
                }
            };
    
            return new RestClient(options);
        }
    }
    

    Rust

    use reqwest::Proxy;
    use std::env;
    
    #[tokio::main]
    async fn main() -> Result<(), Box<dyn std::error::Error>> {
        let proxy_url = env::var("QUOTAGUARDSTATIC_URL")?;
        
        let proxy = Proxy::all(&proxy_url)?;
        
        let client = reqwest::Client::builder()
            .proxy(proxy)
            .build()?;
        
        let response = client
            .post("https://api.partner.com/v2/data")
            .json(&serde_json::json!({"key": "value"}))
            .send()
            .await?;
        
        let data: serde_json::Value = response.json().await?;
        println!("{:?}", data);
        
        Ok(())
    }
    

    Add to Cargo.toml:

    [dependencies]
    reqwest = { version = "0.11", features = ["json", "socks"] }
    tokio = { version = "1", features = ["full"] }
    serde_json = "1.0"
    

    Elixir

    With HTTPoison

    defmodule ProxiedClient do
      def call_protected_api(url, data) do
        proxy_url = System.get_env("QUOTAGUARDSTATIC_URL")
        uri = URI.parse(proxy_url)
        
        [user, pass] = String.split(uri.userinfo, ":")
        
        proxy = {
          String.to_charlist(uri.host),
          uri.port,
          [{:proxy_auth, {String.to_charlist(user), String.to_charlist(pass)}}]
        }
        
        headers = [{"Content-Type", "application/json"}]
        body = Jason.encode!(data)
        options = [proxy: proxy]
        
        case HTTPoison.post(url, body, headers, options) do
          {:ok, %HTTPoison.Response{body: response_body}} ->
            Jason.decode!(response_body)
          {:error, %HTTPoison.Error{reason: reason}} ->
            {:error, reason}
        end
      end
    end
    

    With Req

    defmodule ProxiedClient do
      def call_protected_api(url, data) do
        proxy_url = System.get_env("QUOTAGUARDSTATIC_URL")
        
        Req.post!(url,
          json: data,
          connect_options: [proxy: proxy_url]
        ).body
      end
    end
    

    With Tesla

    defmodule ProxiedClient do
      use Tesla
    
      def client do
        proxy_url = System.get_env("QUOTAGUARDSTATIC_URL")
        
        middleware = [
          {Tesla.Middleware.BaseUrl, "https://api.partner.com"},
          Tesla.Middleware.JSON
        ]
    
        adapter = {Tesla.Adapter.Hackney, [proxy: proxy_url]}
        Tesla.client(middleware, adapter)
      end
    
      def call_protected_api(path, data) do
        client()
        |> post(path, data)
      end
    end
    

    Kotlin

    import okhttp3.*
    import java.net.InetSocketAddress
    import java.net.Proxy
    import java.net.URL
    
    fun createProxiedClient(): OkHttpClient {
        val proxyUrlStr = System.getenv("QUOTAGUARDSTATIC_URL")
        val proxyUrl = URL(proxyUrlStr)
        
        val userInfo = proxyUrl.userInfo
        val user = userInfo.substringBefore(':')
        val password = userInfo.substringAfter(':')
        
        val proxy = Proxy(Proxy.Type.HTTP, InetSocketAddress(proxyUrl.host, proxyUrl.port))
        
        val proxyAuthenticator = Authenticator { _, response ->
            val credential = Credentials.basic(user, password)
            response.request.newBuilder()
                .header("Proxy-Authorization", credential)
                .build()
        }
        
        return OkHttpClient.Builder()
            .proxy(proxy)
            .proxyAuthenticator(proxyAuthenticator)
            .build()
    }
    

    Scala

    import sttp.client3._
    import sttp.client3.httpclient.HttpClientSyncBackend
    import java.net.{InetSocketAddress, PasswordAuthentication, Proxy, Authenticator}
    
    object ProxiedClient {
      def call(url: String): String = {
        val proxyUrl = new java.net.URL(sys.env("QUOTAGUARDSTATIC_URL"))
        val userInfo = proxyUrl.getUserInfo.split(":")
        
        Authenticator.setDefault(new Authenticator {
          override def getPasswordAuthentication: PasswordAuthentication =
            new PasswordAuthentication(userInfo(0), userInfo(1).toCharArray)
        })
        
        val backend = HttpClientSyncBackend(
          options = SttpBackendOptions.httpProxy(proxyUrl.getHost, proxyUrl.getPort)
        )
        
        val request = basicRequest.get(uri"$url")
        val response = request.send(backend)
        
        response.body.getOrElse("")
      }
    }
    

    Swift

    import Foundation
    
    class ProxiedClient {
        static func callProtectedAPI(url: URL, data: [String: Any], completion: @escaping (Result<[String: Any], Error>) -> Void) {
            guard let proxyUrlString = ProcessInfo.processInfo.environment["QUOTAGUARDSTATIC_URL"],
                  let proxyUrl = URL(string: proxyUrlString) else {
                return
            }
            
            let config = URLSessionConfiguration.default
            config.connectionProxyDictionary = [
                kCFNetworkProxiesHTTPEnable: true,
                kCFNetworkProxiesHTTPProxy: proxyUrl.host!,
                kCFNetworkProxiesHTTPPort: proxyUrl.port!,
                kCFNetworkProxiesHTTPSEnable: true,
                kCFNetworkProxiesHTTPSProxy: proxyUrl.host!,
                kCFNetworkProxiesHTTPSPort: proxyUrl.port!
            ]
            
            let session = URLSession(configuration: config)
            var request = URLRequest(url: url)
            request.httpMethod = "POST"
            request.setValue("application/json", forHTTPHeaderField: "Content-Type")
            request.httpBody = try? JSONSerialization.data(withJSONObject: data)
            
            session.dataTask(with: request) { data, response, error in
                if let error = error {
                    completion(.failure(error))
                    return
                }
                
                if let data = data,
                   let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any] {
                    completion(.success(json))
                }
            }.resume()
        }
    }
    

    Database Connections (SOCKS5)

    For non-HTTP protocols like PostgreSQL, MySQL, MongoDB, or SFTP, use QuotaGuard’s SOCKS5 proxy on port 1080.

    Your SOCKS5 proxy URL:

    socks5://username:password@us-east-static-01.quotaguard.com:1080
    

    Python with PySocks

    import os
    import socks
    import socket
    
    proxy_url = os.environ.get('QUOTAGUARDSTATIC_URL')
    # Parse the URL to get host, port, user, password
    
    socks.set_default_proxy(
        socks.SOCKS5,
        'us-east-static-01.quotaguard.com',
        1080,
        username='your-username',
        password='your-password'
    )
    socket.socket = socks.socksocket
    
    # Now database connections use the SOCKS5 proxy
    import psycopg2
    conn = psycopg2.connect(
        host='your-database.example.com',
        database='mydb',
        user='dbuser',
        password='dbpass'
    )
    

    Using QGTunnel

    For complex multi-protocol setups, QGTunnel creates local port mappings that route traffic through QuotaGuard’s SOCKS5 proxy transparently.

    1. Download QGTunnel from QuotaGuard dashboard
    2. Configure tunnel mappings in the dashboard
    3. Download the .qgtunnel configuration file
    4. Run your app with: bin/qgtunnel your-app-command

    Your application connects to localhost, and QGTunnel handles the proxying.


    Selective Proxying

    Only route requests that need static IPs through the proxy:

    const axios = require('axios');
    const { HttpsProxyAgent } = require('https-proxy-agent');
    
    const proxyUrl = process.env.QUOTAGUARDSTATIC_URL;
    const proxyAgent = new HttpsProxyAgent(proxyUrl);
    
    // Services that require static IPs
    const PROTECTED_DOMAINS = [
        'api.paymentprovider.com',
        'api.partner.com',
        'sftp.enterprise.com'
    ];
    
    function needsStaticIP(url) {
        const hostname = new URL(url).hostname;
        return PROTECTED_DOMAINS.some(domain => hostname.includes(domain));
    }
    
    async function smartRequest(url, options = {}) {
        const config = { ...options };
        
        if (needsStaticIP(url)) {
            config.httpsAgent = proxyAgent;
        }
        
        return axios(url, config);
    }
    

    This approach minimizes latency for requests that don’t need static IPs while ensuring protected services always receive requests from your allowlisted addresses.


    Testing Your Configuration

    Verify your static IP is working by calling the QuotaGuard test endpoint:

    // Node.js
    const axios = require('axios');
    const { HttpsProxyAgent } = require('https-proxy-agent');
    
    const agent = new HttpsProxyAgent(process.env.QUOTAGUARDSTATIC_URL);
    
    const response = await axios.get('https://ip.quotaguard.com', {
        httpsAgent: agent
    });
    console.log('Your static IP:', response.data);
    
    # Python
    import os
    import requests
    
    proxies = {
        'http': os.environ.get('QUOTAGUARDSTATIC_URL'),
        'https': os.environ.get('QUOTAGUARDSTATIC_URL')
    }
    
    response = requests.get('https://ip.quotaguard.com', proxies=proxies)
    print('Your static IP:', response.json())
    

    The returned IP should match one of the two static IPs shown in your QuotaGuard dashboard. Run multiple times to see both IPs in action (load-balanced).


    Troubleshooting

    407 Proxy Authentication Required

    Your proxy credentials are incorrect. Verify:

    1. The QUOTAGUARDSTATIC_URL environment variable is set correctly
    2. Username and password match your QuotaGuard dashboard
    3. Special characters in the password are URL-encoded

    Connection Timeout

    1. Verify the QuotaGuard proxy hostname is correct (check your dashboard)
    2. Ensure port 9293 is used for HTTP proxy, port 1080 for SOCKS5
    3. Check that your deployment environment allows outbound connections
    4. Verify no firewall rules block traffic to QuotaGuard

    Wrong IP Address Returned

    The proxy may not be configured correctly:

    1. Verify the environment variable is being read in your code
    2. Check that you’re passing the proxy agent to the specific request
    3. Ensure you’re not reusing an HTTP client instance created without the proxy

    SSL/TLS Errors

    If you see certificate errors:

    1. Ensure you’re using httpsAgent (not httpAgent) for HTTPS requests
    2. Check that your HTTP client library version supports modern TLS

    QuotaGuard Static vs QuotaGuard Shield

    FeatureQuotaGuard StaticQuotaGuard Shield
    ProtocolHTTP/SOCKS5HTTPS/SOCKS5 over TLS
    EncryptionStandard proxySSL Passthrough (E2EE)
    Best forGeneral API accessHIPAA, PCI-DSS, regulated data
    Starting price$19/month$69/month

    For most Emergent applications, QuotaGuard Static provides everything you need. Choose Shield if you’re handling protected health information (PHI), payment card data, or have specific compliance requirements where end-to-end encryption through the proxy is mandatory.


    Ready to Get Started?

    Get in touch or create a free trial account.

    Try QuotaGuard Now

    Contact Support


    Ready to Get Started?

    Get in touch or create a free trial account