mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 10:05:21 +00:00
Bundle tor (#339)
* tor started * tor works * tor code * improve manager * works * move tor icon * werks * arti works * arti works * arti works with reconnect * delay fix * refactor
This commit is contained in:
@@ -113,12 +113,9 @@ class NostrRelayManager private constructor() {
|
||||
private var subscriptionValidationJob: Job? = null
|
||||
private val SUBSCRIPTION_VALIDATION_INTERVAL = 30000L // 30 seconds
|
||||
|
||||
// OkHttp client for WebSocket connections
|
||||
private val httpClient = OkHttpClient.Builder()
|
||||
.connectTimeout(10, TimeUnit.SECONDS)
|
||||
.readTimeout(0, TimeUnit.SECONDS) // No read timeout for WebSocket
|
||||
.writeTimeout(10, TimeUnit.SECONDS)
|
||||
.build()
|
||||
// OkHttp client for WebSocket connections (via provider to honor Tor)
|
||||
private val httpClient: OkHttpClient
|
||||
get() = com.bitchat.android.net.OkHttpProvider.webSocketClient()
|
||||
|
||||
private val gson by lazy { NostrRequest.createGson() }
|
||||
|
||||
|
||||
@@ -34,13 +34,8 @@ object RelayDirectory {
|
||||
private val ONE_DAY_MS = TimeUnit.DAYS.toMillis(1)
|
||||
|
||||
private val ioScope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||
private val httpClient: OkHttpClient by lazy {
|
||||
OkHttpClient.Builder()
|
||||
.callTimeout(15, TimeUnit.SECONDS)
|
||||
.connectTimeout(10, TimeUnit.SECONDS)
|
||||
.readTimeout(15, TimeUnit.SECONDS)
|
||||
.build()
|
||||
}
|
||||
private val httpClient: OkHttpClient
|
||||
get() = com.bitchat.android.net.OkHttpProvider.httpClient()
|
||||
|
||||
data class RelayInfo(
|
||||
val url: String,
|
||||
@@ -306,4 +301,3 @@ object RelayDirectory {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user