LibreTube/app/src/main/java/com/github/libretube/api/CronetHelper.kt

17 lines
563 B
Kotlin
Raw Normal View History

2022-08-14 13:25:28 +05:30
package com.github.libretube.api
2023-01-31 21:16:36 +05:30
import com.github.libretube.LibreTubeApp
2022-07-21 23:28:38 +05:30
import com.google.net.cronet.okhttptransport.CronetCallFactory
import org.chromium.net.CronetEngine
2023-01-31 21:16:36 +05:30
object CronetHelper {
val cronetEngine: CronetEngine = CronetEngine.Builder(LibreTubeApp.instance)
.enableHttp2(true)
.enableQuic(true)
.enableBrotli(true)
.enableHttpCache(CronetEngine.Builder.HTTP_CACHE_IN_MEMORY, 1024L * 1024L) // 1MiB
.build()
2023-01-31 21:16:36 +05:30
val callFactory: CronetCallFactory = CronetCallFactory.newBuilder(cronetEngine).build()
}