2022-08-14 13:25:28 +05:30
|
|
|
package com.github.libretube.api
|
2022-05-27 07:04:44 +05:30
|
|
|
|
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
|
2022-05-27 07:04:44 +05:30
|
|
|
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()
|
2022-05-27 07:04:44 +05:30
|
|
|
|
2023-01-31 21:16:36 +05:30
|
|
|
val callFactory: CronetCallFactory = CronetCallFactory.newBuilder(cronetEngine).build()
|
2022-05-27 07:04:44 +05:30
|
|
|
}
|