|
|
@ -1,7 +1,10 @@ |
|
|
|
package io.legado.app.help.http |
|
|
|
package io.legado.app.help.http |
|
|
|
|
|
|
|
|
|
|
|
import kotlinx.coroutines.suspendCancellableCoroutine |
|
|
|
import kotlinx.coroutines.suspendCancellableCoroutine |
|
|
|
import okhttp3.* |
|
|
|
import okhttp3.ConnectionSpec |
|
|
|
|
|
|
|
import okhttp3.Credentials |
|
|
|
|
|
|
|
import okhttp3.Interceptor |
|
|
|
|
|
|
|
import okhttp3.OkHttpClient |
|
|
|
import java.net.InetSocketAddress |
|
|
|
import java.net.InetSocketAddress |
|
|
|
import java.net.Proxy |
|
|
|
import java.net.Proxy |
|
|
|
import java.util.concurrent.ConcurrentHashMap |
|
|
|
import java.util.concurrent.ConcurrentHashMap |
|
|
@ -33,7 +36,6 @@ object HttpHelper { |
|
|
|
.connectionSpecs(specs) |
|
|
|
.connectionSpecs(specs) |
|
|
|
.followRedirects(true) |
|
|
|
.followRedirects(true) |
|
|
|
.followSslRedirects(true) |
|
|
|
.followSslRedirects(true) |
|
|
|
.protocols(listOf(Protocol.HTTP_1_1)) |
|
|
|
|
|
|
|
.addInterceptor(getHeaderInterceptor()) |
|
|
|
.addInterceptor(getHeaderInterceptor()) |
|
|
|
|
|
|
|
|
|
|
|
builder.build() |
|
|
|
builder.build() |
|
|
|