proxy_list.json
Overview
proxy_list.json is a JSON-formatted data file designed to store an array of proxy server configurations. Each configuration object in the array associates a proxy server URL with its corresponding cryptographic certificate in PEM format. This structure enables secure communication through proxies by providing the necessary certificates to verify the identity of the proxy servers.
The file is intended for use by components or modules that require proxy connection details, including the URL and security credentials, allowing them to establish trusted and authenticated connections.
Structure and Content
The file contains a JSON array where each element is an object with the following properties:
Property | Type | Description |
|---|---|---|
| String | The full URL of the proxy server, including scheme, host, optional port, and path. |
| String | The X.509 certificate for the proxy server in PEM format, including the |
Sample Entry
{
"url": "https://www.example.com/path/path1",
"cert": "-----BEGIN CERTIFICATE-----\nMIIBWzCCAQCgAwIBAgIUVQCMPQZ8PYCKYWzNeySt/DyTJAMwCgYIKoZIzj0EAwIw\nITEfMB0GA1UEAwwWcmNnZW4gc2VsZiBzaWduZWQgY2VydDAgFw03NTAxMDEwMDAw\nMDBaGA80MDk2MDEwMTAwMDAwMFowITEfMB0GA1UEAwwWcmNnZW4gc2VsZiBzaWdu\nZWQgY2VydDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABI4RYVCqhTLpm4uZ2g4O\nB+w5mfDZvtqOwV7felR7ZFcxXu2lhEqVcd8I32RIqukSfJddopfrP7JQkwoVApDl\nhkyjFDASMBAGA1UdEQQJMAeCBVs6OjFdMAoGCCqGSM49BAMCA0kAMEYCIQCEDCR4\nfCECGL41JQnpQO+S89epyGbp96ij7/I/H1eR4wIhAI/VDdnc+8mUajOs3jswvp46\nCtRDY1voE6J17J6sd3Os\n-----END CERTIFICATE-----\n"
}
Important Implementation Details
Certificate Encoding: Certificates are stored as strings with explicit newline characters (
\n) to preserve the PEM format. This is critical for cryptographic validation processes that expect the precise PEM encoding.URL Structure: The proxy URLs include scheme (https), host, optional port (e.g.,
:4321), and path segments. This allows fine-grained proxy routing and supports non-standard ports.Array Format: Multiple proxy configurations can coexist within the same file, enabling clients to select or iterate through various proxies.
Usage
This file can be consumed by network modules or proxy management components that:
Read and parse the JSON array.
Extract the proxy URL to configure HTTP or HTTPS proxy settings.
Use the associated certificate to verify the server's identity during SSL/TLS handshake.
Support secure proxy connections by validating the server certificate against the provided PEM certificate.
Example Usage in Pseudocode
proxy_list = parse_json('proxy_list.json')
for proxy in proxy_list:
url = proxy["url"]
certificate_pem = proxy["cert"]
connection = establish_secure_connection(url, certificate_pem)
if connection.is_verified():
use_proxy(connection)
Interactions with Other System Components
Network Layer: Modules responsible for HTTP/HTTPS communication utilize this file to configure proxy endpoints and security parameters.
Security Modules: Components that handle certificate validation consume the PEM certificates for verifying proxy authenticity.
Configuration Management: This file acts as a configuration source that can be updated or extended to include new proxy entries without code changes.
Visual Diagram
flowchart TD
A[proxy_list.json] --> B[Parse JSON Array]
B --> C{For Each Proxy Entry}
C --> D[Extract URL]
C --> E[Extract Certificate PEM]
D --> F[Configure Proxy Connection]
E --> G[Validate Proxy Certificate]
F --> H[Establish Secure Connection]
G --> H
H --> I[Use Proxy for Network Requests]
This diagram illustrates the workflow of how the data in proxy_list.json is processed and used to establish secure proxy connections. It shows the parsing of the file, extraction of proxy details, configuration of connections, certificate validation, and eventual use in network communication.