Skip to content

createNetworkPrivacyClient()

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / 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

NetworkPrivacyConfig

Network privacy configuration

Promise<{ fetch: ProxiedFetch; rotateCircuit: () => Promise<boolean>; status: ProxyCheckResult; agent: Agent | undefined; }>

Proxied fetch function and utilities

const network = await createNetworkPrivacyClient({
proxy: 'tor',
rotateCircuit: true,
torControlPassword: 'my-password',
})
// Use proxied fetch
const response = await network.fetch('https://api.example.com')
// Rotate circuit manually
await network.rotateCircuit()
// Check status
console.log(network.status) // { type: 'tor', connected: true, ... }