createNetworkPrivacyClient()
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / createNetworkPrivacyClient
Function: createNetworkPrivacyClient()
Section titled “Function: createNetworkPrivacyClient()”createNetworkPrivacyClient(
config?):Promise<{fetch:ProxiedFetch;rotateCircuit: () =>Promise<boolean>;status:ProxyCheckResult;agent:Agent|undefined; }>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:17065
Create a network privacy client
Parameters
Section titled “Parameters”config?
Section titled “config?”Network privacy configuration
Returns
Section titled “Returns”Promise<{ fetch: ProxiedFetch; rotateCircuit: () => Promise<boolean>; status: ProxyCheckResult; agent: Agent | undefined; }>
Proxied fetch function and utilities
Example
Section titled “Example”const network = await createNetworkPrivacyClient({ proxy: 'tor', rotateCircuit: true, torControlPassword: 'my-password',})
// Use proxied fetchconst response = await network.fetch('https://api.example.com')
// Rotate circuit manuallyawait network.rotateCircuit()
// Check statusconsole.log(network.status) // { type: 'tor', connected: true, ... }