Configure a Network Proxy (React Native)

If a network proxy is required a configuration builder can be provided when initializing the SDK. Network proxies may be required if end users generate sessions on devices that have proxy requirements. To configure, set your proxy parameters when initializing the SDK.

🚧

These proxy configurations apply to proxies that accept HTTP CONNECT requests to create a tunnel to the destination server. If you have set up a proxy following our guide to proxy traffic through your own domain, you should instead provide your proxy URL as the serverURL during initialization.

LogRocket.init('<APP_SLUG>', {
  serverURL: 'https://example.com/i',
});

LogRocket.init('<APP_SLUG>', {
  // To configure the iOS proxy use:
  iosProxyConfiguration: {
    proxyUsername: 'username',
    proxyPassword: 'password',
    httpEnable: true,
    httpProxy: '10.0.2.2',
    httpPort: 8888,
  },
  // To configure the Android proxy use:
  androidProxy: {
    host: '10.0.2.2',
    port: 8888,
    authHeaderName: 'Proxy-Authorization',
    authHeaderValue: 'Basic authorizationToken',
  },
});