Skip to main content
POST
/
api
/
proxy
/
test-connectivity
{
  "proxy_address": "proxy.example.com",
  "proxy_port": 8080,
  "proxy_username": "proxy_user",
  "proxy_password": "proxy_password123"
}
{
  "success": true,
  "message": "Proxy test successful",
  "ip": "8.8.8.8" // External IP detected via proxy
}

Overview

This endpoint allows you to test the connectivity of a proxy configuration (typically a manual one) before saving or using it. The backend server attempts to make a request through the provided proxy details to determine if it’s reachable and operational. This is particularly useful for validating user-provided manual proxies to ensure they are correctly configured and accessible from the OnlyAutomator infrastructure.
This endpoint requires specific permissions and might expose sensitive information about the available proxy pool. It should typically only be accessible to administrators or internal services.
This endpoint requires authentication via bearer token representing a valid user session managed by Supabase Auth (cookies).Testing Note: Due to the requirement for a live user session, this endpoint cannot be successfully tested directly using the ‘Send’ button in this documentation with a static token.To test:
  1. Call this endpoint from your web application after logging in.
  2. Use curl or a similar tool with a valid, current user JWT obtained from your browser’s session after logging in.
Retrieving JWT Token for Testing: To test endpoints requiring a user session with tools like curl, you need the JWT access token stored by Supabase Auth in your browser.
  1. Log in to your application normally in your browser.
  2. Open Developer Tools (usually F12).
  3. Go to the Application tab (it might be called Storage in Firefox).
  4. Under the Storage section, find Cookies and select your application’s domain (e.g., http://localhost:3000 or https://onlyautomator.com).
  5. Look for a cookie named similar to sb-access-token (the exact name might vary slightly based on Supabase configuration).
  6. Copy the entire value of this cookie. This is your Bearer token.
  7. Use this copied value in the Authorization: Bearer <your_copied_token> header for your curl or other API tool requests.
Note: This token has a limited lifetime and you’ll need to copy a fresh one after it expires.

Request Body

The request body must contain the proxy’s address and port. Username and password are optional but should be included if the proxy requires authentication.
{
  "proxy_address": "proxy.example.com",
  "proxy_port": 8080,
  "proxy_username": "proxy_user",
  "proxy_password": "proxy_password123"
}

Responses

The response indicates whether the connectivity test was successful.
{
  "success": true,
  "message": "Proxy test successful",
  "ip": "8.8.8.8" // External IP detected via proxy
}

Response Details

  • success: (boolean) true if the proxy was reached successfully, false otherwise.
  • message: (string | null) A message indicating the outcome of the test.
  • ip: (string | null) If successful, the external IP address detected by the target server when routing through the proxy.
  • error: (string | null) If the test failed, provides details about the error (e.g., ECONNREFUSED, ETIMEDOUT, authentication error).
This endpoint helps ensure that manually configured proxies are viable before they are associated with an account for scraping or other activities.

Authorizations

Authorization
string
header
required

Standard user JWT token for authentication.

Headers

Authorization
string
required

Bearer token for authentication (JWT)

Body

application/json
proxy_address
string
required
Example:

"proxy.example.com"

proxy_port
integer
required
Example:

8888

proxy_username
string | null
Example:

"testUser"

proxy_password
string<password> | null
Example:

"testPass123"

Response

Proxy connectivity successful.

success
boolean
Example:

true

message
string
Example:

"Proxy connection test successful."

tested_proxy
object