ddp_utils.ws_intercom

import ddp_utils.ws_intercom

Expose unified WSIntercom extension and system-VPN services.

The compatibility facade selects the system implementation when the manifest contains a true system value. Otherwise it prepares the browser-extension implementation. Lower-level Windscribe proxy and browser API components remain available for explicit use.

Examples

Create a system-backed facade from effective project settings:

from ddp_utils.ws_intercom import WSIntercomInstance

vpn = WSIntercomInstance(
    manifest={"system": True},
    project_name="59-IN-Criminal",
)
class ddp_utils.ws_intercom.WSIntercomInstance(manifest: dict, target_url: str = None, download_sub_directory: str = None, base_url: str = None, directory: str = None, project_name: str = None, logger=None, debug: bool = False)

Bases: object

Delegate a stable VPN interface to the selected implementation.

A true manifest["system"] selects SystemVPNManager; every other manifest selects the browser-extension implementation.

Examples

Prepare an extension-backed session:

instance = WSIntercomInstance(
    manifest={"remote_url": "https://wsi.example/api"},
    target_url="https://example.com",
    download_sub_directory="Example",
)

Create and retain the implementation selected by the manifest.

Parameters

Name

Type

Description

manifest

dict

Effective VPN settings. system controls provider selection; remaining fields are forwarded to that provider.

target_url

str

Extension auto-rotation target URL.

download_sub_directory

str

Extension download subdirectory.

base_url

str

Optional extension interface base URL.

directory

str

Explicit runtime data directory for either provider.

project_name

str

Project namespace used to isolate runtime state.

logger

Optional compatible diagnostic logger.

debug

bool

Enable provider-specific detailed diagnostics.

Raises

Exception

Description

ValueError

Provider configuration or runtime path data is invalid.

OSError

Provider directories or configuration files cannot be prepared.

RuntimeError

The selected system VPN cannot be initialized.

Examples

Select the system implementation explicitly:

instance = WSIntercomInstance(
    manifest={"system": True},
    directory=".runtime/vpn",
)
property interface

Return the provider-specific interface or activation URL.

Returns

Value exposed as interface by the selected provider.

Examples

Open the extension interface when using browser mode:

browser.open(instance.interface)
property data_dir

Return the selected provider’s runtime data directory.

Returns

Directory containing provider cache, history, and state files.

Examples

Locate provider-owned state:

print(instance.data_dir)
property history_cache

Return the selected provider’s cached connection history.

Returns

Provider-specific collection of recent data centers or locations.

Examples

Inspect the most recent selection:

latest = instance.history_cache[-1] if instance.history_cache else None
property history_file

Return the selected provider’s connection-history file reference.

Returns

Provider-defined path or filename used for persistent history.

Examples

Record the history location in diagnostics:

print(instance.history_file)
property error_file

Return the selected provider’s error-file reference.

Returns

Provider-defined path or filename used for fatal errors.

Examples

Monitor the provider error artifact:

print(instance.error_file)
add_to_history(datacenter)

Delegate persistence of one connected data center or location.

Parameters

Name

Description

datacenter

Provider-supported identifier or location object.

Returns

None.

Examples

Remember a successful extension location:

instance.add_to_history(
    {"DataCenter": {"id": 86, "city": "Chicago"}}
)

Submodules