JBrowser Source Docs

jbrowser.services.network

Generated from the source code of JBrowser 1.5.4.

jbrowser/services/network.py · 304 lines

DNS resolver selection (DNS-over-HTTPS), proxy routing and localhost developer tooling.

Constants#

Name Value
DNS_MODES {'system': {'label': 'OS Default', 'detail': 'Use the resolver configured in Windows.',…
DEV_PORTS [(3000, 'React / Next.js / Express'), (5173, 'Vite'), (8000, 'Django / FastAPI / http.s…

DnsManager#

class DnsManager(QObject)source
DnsManager(settings: Settings, parent: QObject | None=None)

Switches Chromium's stub resolver between system DNS and DNS-over-HTTPS at runtime.

PyQt6 exposes QWebEngineGlobalSettings.DnsMode but not the static setDnsMode() call, so the exported C++ function is invoked through ctypes. DnsMode is passed by value (MSVC x64: pointer to a temporary that the callee destroys), so the shared QStringList payload is ref-counted up once to balance the callee-side destructor.

Signals

Signal Arguments
applied (str, bool)

DnsManager.available#

property availablesource

DnsManager.apply#

apply(mode: str | None=None) -> boolsource

ProxyManager#

class ProxyManager(QObject)source
ProxyManager(settings: Settings, parent: QObject | None=None)

Routes engine traffic through HTTP / SOCKS5 proxies (applied live) or an HTTPS (TLS-to-proxy) server (applied through Chromium flags at startup).

Chromium owns one network stack per process, so per-space overrides follow the foreground space: switching spaces re-routes traffic and "kicks" each profile's network context so the new configuration is used by the very next request.

Signals

Signal Arguments
changed (str)

Attributes

Name Value
KICK_URL 'http://proxy-refresh.jbrowser.invalid/'

ProxyManager.set_profile_provider#

set_profile_provider(provider: Callable[[], list[QWebEngineProfile]]) -> Nonesource

ProxyManager.startup_flags#

static startup_flags(settings: Settings) -> list[str]source

ProxyManager.global_config#

global_config() -> dictsource

ProxyManager.requests_proxies#

requests_proxies() -> dictsource

The global proxy in requests form, so JBrowser's own downloads (block lists, threat lists) take the same route as the pages.

ProxyManager.effective#

effective(space_proxy: dict | None) -> dictsource

ProxyManager.apply#

apply(space_proxy: dict | None=None, force: bool=False) -> Nonesource

ProxyManager.release_all#

release_all() -> Nonesource

ProxyManager.credentials_for#

credentials_for(host: str, space_proxy: dict | None) -> tuple[str, str] | Nonesource

ProxyManager.toggle_global#

toggle_global() -> strsource

PortProbe#

class PortProbe(QObject)source

Asynchronously checks whether something is listening on local ports.

Signals

Signal Arguments
result (int, bool)

PortProbe.probe#

probe(port: int, host: str='127.0.0.1', timeout_ms: int=600) -> Nonesource

Functions#

protect_secret#

protect_secret(value: str) -> strsource

reveal_secret#

reveal_secret(value: str) -> strsource

normalize_proxy#

normalize_proxy(cfg: dict | None) -> dictsource

describe_proxy#

describe_proxy(cfg: dict | None) -> strsource