Skip to content

Technical FAQ

Common questions about OkkProxy technical integration and usage.

What programming languages are supported?

OkkProxy proxies work with any programming language that supports HTTP/HTTPS or SOCKS5 protocols.

Common Language Examples

Python

python
import requests

proxies = {
    'http': 'http://username:[email protected]:8080',
    'https': 'http://username:[email protected]:8080'
}

response = requests.get('https://example.com', proxies=proxies)
print(response.text)

Node.js

javascript
const axios = require('axios');

const proxy = {
  host: 'proxy.okkproxy.com',
  port: 8080,
  auth: {
    username: 'your_username',
    password: 'your_password'
  }
};

axios.get('https://example.com', { proxy })
  .then(response => console.log(response.data))
  .catch(error => console.error(error));

Java

java
import java.net.*;
import java.io.*;

public class ProxyExample {
    public static void main(String[] args) throws Exception {
        String proxyHost = "proxy.okkproxy.com";
        int proxyPort = 8080;
        String username = "your_username";
        String password = "your_password";

        Authenticator.setDefault(new Authenticator() {
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(username, password.toCharArray());
            }
        });

        Proxy proxy = new Proxy(Proxy.Type.HTTP,
            new InetSocketAddress(proxyHost, proxyPort));

        URL url = new URL("https://example.com");
        HttpURLConnection conn = (HttpURLConnection) url.openConnection(proxy);

        BufferedReader in = new BufferedReader(
            new InputStreamReader(conn.getInputStream()));
        String inputLine;
        while ((inputLine = in.readLine()) != null) {
            System.out.println(inputLine);
        }
        in.close();
    }
}

PHP

php
<?php
$proxy = 'proxy.okkproxy.com:8080';
$proxyAuth = 'username:password';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://example.com');
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyAuth);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>

How to use proxy in browsers?

Chrome/Edge

  1. Install proxy extension (e.g., Proxy SwitchyOmega)
  2. Configure proxy server information
  3. Enable proxy

Firefox

  1. Open Settings → Network Settings
  2. Select "Manual proxy configuration"
  3. Fill in proxy server and port
  4. Check "Use this proxy server for all protocols"

Safari

  1. Open System Preferences → Network
  2. Select current network connection
  3. Click "Advanced" → "Proxies"
  4. Configure HTTP and HTTPS proxy

How to configure web scraping frameworks with proxy?

Scrapy

python
# settings.py
DOWNLOADER_MIDDLEWARES = {
    'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware': 1,
}

# Use in spider
class MySpider(scrapy.Spider):
    name = 'myspider'

    def start_requests(self):
        proxy = 'http://username:[email protected]:8080'
        for url in self.start_urls:
            yield scrapy.Request(url,
                                meta={'proxy': proxy})

Selenium

python
from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType

proxy = Proxy()
proxy.proxy_type = ProxyType.MANUAL
proxy.http_proxy = 'proxy.okkproxy.com:8080'
proxy.ssl_proxy = 'proxy.okkproxy.com:8080'

capabilities = webdriver.DesiredCapabilities.CHROME
proxy.add_to_capabilities(capabilities)

driver = webdriver.Chrome(desired_capabilities=capabilities)
driver.get('https://example.com')

Playwright

python
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(proxy={
        'server': 'http://proxy.okkproxy.com:8080',
        'username': 'your_username',
        'password': 'your_password'
    })
    page = browser.new_page()
    page.goto('https://example.com')
    browser.close()

Puppeteer

javascript
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    args: [
      '--proxy-server=proxy.okkproxy.com:8080'
    ]
  });

  const page = await browser.newPage();
  await page.authenticate({
    username: 'your_username',
    password: 'your_password'
  });

  await page.goto('https://example.com');
  await browser.close();
})();

How to handle timeout issues?

Set Timeout Duration

Python requests

python
import requests

proxies = {
    'http': 'http://username:[email protected]:8080'
}

try:
    response = requests.get(
        'https://example.com',
        proxies=proxies,
        timeout=30  # 30 second timeout
    )
except requests.Timeout:
    print("Request timeout")

Node.js axios

javascript
axios.get('https://example.com', {
  proxy: {
    host: 'proxy.okkproxy.com',
    port: 8080
  },
  timeout: 30000  // 30 second timeout
})

Timeout Troubleshooting

  1. Check network connection
  2. Try different proxy nodes
  3. Increase timeout duration
  4. Check target website response speed

How to handle SSL certificate errors?

Python

python
import requests

proxies = {
    'http': 'http://username:[email protected]:8080',
    'https': 'http://username:[email protected]:8080'
}

# Disable SSL verification (not recommended in production)
response = requests.get(
    'https://example.com',
    proxies=proxies,
    verify=False
)

# Or specify certificate path
response = requests.get(
    'https://example.com',
    proxies=proxies,
    verify='/path/to/cert.pem'
)

Node.js

javascript
const https = require('https');
const axios = require('axios');

const agent = new https.Agent({
  rejectUnauthorized: false  // Disable certificate verification
});

axios.get('https://example.com', {
  httpsAgent: agent,
  proxy: {
    host: 'proxy.okkproxy.com',
    port: 8080
  }
});

How to implement request retries?

Python with retrying

python
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
import requests

# Configure retry strategy
retry_strategy = Retry(
    total=3,  # Maximum 3 retries
    backoff_factor=1,  # Retry interval
    status_forcelist=[429, 500, 502, 503, 504]
)

adapter = HTTPAdapter(max_retries=retry_strategy)
session = requests.Session()
session.mount("http://", adapter)
session.mount("https://", adapter)

proxies = {
    'http': 'http://username:[email protected]:8080'
}

response = session.get('https://example.com', proxies=proxies)

Node.js with axios-retry

javascript
const axios = require('axios');
const axiosRetry = require('axios-retry');

axiosRetry(axios, {
  retries: 3,  // Number of retries
  retryDelay: axiosRetry.exponentialDelay,
  retryCondition: (error) => {
    return axiosRetry.isNetworkOrIdempotentRequestError(error)
      || error.response.status === 429;
  }
});

axios.get('https://example.com', {
  proxy: {
    host: 'proxy.okkproxy.com',
    port: 8080
  }
});

How to manage proxy pool?

Simple Proxy Pool Implementation

python
import requests
import random
from queue import Queue

class ProxyPool:
    def __init__(self):
        self.proxies = Queue()
        self.bad_proxies = set()

    def add_proxy(self, proxy):
        """Add proxy to pool"""
        self.proxies.put(proxy)

    def get_proxy(self):
        """Get an available proxy"""
        if self.proxies.empty():
            raise Exception("Proxy pool is empty")
        return self.proxies.get()

    def return_proxy(self, proxy, is_good=True):
        """Return proxy"""
        if is_good:
            self.proxies.put(proxy)
        else:
            self.bad_proxies.add(proxy)

    def test_proxy(self, proxy):
        """Test if proxy is available"""
        try:
            response = requests.get(
                'https://httpbin.org/ip',
                proxies={'http': proxy, 'https': proxy},
                timeout=10
            )
            return response.status_code == 200
        except:
            return False

# Usage example
pool = ProxyPool()

# Add proxies
proxies_list = [
    'http://username:[email protected]:8080',
    'http://username:[email protected]:8080',
    'http://username:[email protected]:8080',
]

for proxy in proxies_list:
    if pool.test_proxy(proxy):
        pool.add_proxy(proxy)

# Use proxy
proxy = pool.get_proxy()
try:
    response = requests.get('https://example.com',
                          proxies={'http': proxy})
    pool.return_proxy(proxy, is_good=True)
except:
    pool.return_proxy(proxy, is_good=False)

How to monitor proxy status?

Real-time Monitoring Script

python
import requests
import time
from datetime import datetime

def monitor_proxy(proxy, interval=60):
    """
    Monitor proxy status
    proxy: Proxy address
    interval: Check interval (seconds)
    """
    while True:
        try:
            start_time = time.time()
            response = requests.get(
                'https://httpbin.org/ip',
                proxies={'http': proxy, 'https': proxy},
                timeout=10
            )
            response_time = time.time() - start_time

            status = {
                'time': datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
                'proxy': proxy,
                'status': 'OK' if response.status_code == 200 else 'FAIL',
                'response_time': f'{response_time:.2f}s',
                'ip': response.json().get('origin', 'Unknown')
            }

            print(f"[{status['time']}] {status['proxy']} - "
                  f"{status['status']} - {status['response_time']} - "
                  f"IP: {status['ip']}")

        except Exception as e:
            print(f"[{datetime.now()}] {proxy} - ERROR: {str(e)}")

        time.sleep(interval)

# Usage
proxy = 'http://username:[email protected]:8080'
monitor_proxy(proxy, interval=300)  # Check every 5 minutes

API Usage Limits

Request Frequency Limits

  • Basic Plan: 100 requests/minute
  • Professional Plan: 500 requests/minute
  • Enterprise Plan: Unlimited

Concurrent Connection Limits

  • Basic Plan: 10 concurrent
  • Professional Plan: 50 concurrent
  • Enterprise Plan: 200 concurrent

Handling Exceeded Limits

  • Returns 429 status code
  • Implement exponential backoff retry
  • Consider upgrading plan

Have Other Technical Questions?

View more technical documentation: