# Advanced Configurations

Codavel SDK allows the configuration of some advanced settings for enabling some features, configuring security options and increasing the SDK debug level. Please, before changing these settings make sure you know what you are doing. All the methods below are accessible via the BolinaConfiguration object that you need to pass to BolinaInterceptor.start("<deployment-id>", withSecret: "<deployment-secret>", with: config).

# App settings

  • Swift
  • Objective-C
let config = BolinaConfiguration.initBolinaConfiguration() as! BolinaConfiguration
config.addBolinaURLReplacement(originalURLRegex: String!, url: String!)
1
2
  • Adds a new rule to be executed at each HTTP/HTTPS request. If the URL matches the expression configured, then Bolina will replace the matched expression with the configured URL. In case of Bolina fallback, the original URL will be used.
  • Swift
  • Objective-C
config.addFallbackURLReplacement(originalURLRegex: String!, url: String!)
1
  • Adds a new rule to be executed in case of Bolina fallback or performing A/B testing. If the URL used by bolina matches the expression configured, then Bolina will replace the matched expression with the configured URL.
  • Swift
  • Objective-C
config.setConfigFolder(configFolder: String!)
1
  • Sets the path used by Bolina core to store cached info. Default: application specific cache directory on the filesystem.

# A/B Testing setting

  • Swift
  • Objective-C
config.useABTestingPerSession()
1
  • Enables or disables the ab testing per session. This flag changes the behavior of setABTestPercentage. When this flag is set to true, the ab test percentage is calculated per session, otherwise, it is calculated per request. A new session is created each time that Bolina is started.
  • Default: true
  • Swift
  • Objective-C
config.setAbTestingPercentage(percentage: Int32)
1
  • Sets the percentage of requests or sessions using Bolina or HTTP/HTTPS. Should be used with setUseABTestingPerSession to define if the ab testing is per session or per request.
  • Accepted values: Any value between 1 and 100.
  • Default: 1 , meaning that 1% of the requests or sessions will use HTTP/HTTPS, while the remainder 99% will use Bolina.

# Verbose settings

  • Swift
  • Objective-C
config.setVerboseLevel(verboseLevel: String!)
1
  • Changes the verbose level of Bolina client.
  • Accepted values:
    • critical (less logs)
    • info
    • debug
    • trace (more logs).
  • Default: critical

# Protocol settings

  • Swift
  • Objective-C
config.setBolinaPattern(pattern: String!)
1
  • Sets the URLs to be handled via bolina. Any URL that match this pattern will use bolina, on the other hand, a URL that does not match this pattern will be transferred using regular HTTP/HTTPS.
  • Default: Pattern.compile(".*"), meaning all requests are handled.
  • Swift
  • Objective-C
config.useSSLCertificates()
//or
config.setUseSSLCertificates(useSSLCertificates: Bool)
1
2
3
  • Enables/disable the use of SSL certificates.
  • Default: true
  • Swift
  • Objective-C
config.setAllowSelfSignedCerts(allowSelfSignedCerts: Bool)
1
  • Enables/Disable the use of self signed SSL certificates. We strongly recommend the use of this option only for testing purposes.
  • Default: false
  • Swift
  • Objective-C
config.setMaxMemoryAllowed(maxMemoryAllowed: Int)
1
  • Sets the maximum amount of memory used by bolina core, in bytes.
  • Default: 10MB
  • Swift
  • Objective-C
config.setZeroRTT(enableZeroRTT: Bool)
1
  • Enables or disables the use of 0-RTT in Bolina.
  • Default: true
  • Swift
  • Objective-C
config.setTimeToKeepAlive(timeToKeepAlive: Int32)
1
  • Sets the maximum time that a connection will be kept alive, in milliseconds.
  • Default: 120000

# Insights settings

  • Swift
  • Objective-C
config.setMonitorPercentage(percentage: Int32)
1
  • Sets the percentage of requests to be traced for detailed statistics in the insights dashboard. A value of 100 means all requests appear in the dashboard.
  • Default: 100