adapt to current matrix-dart-sdk changes
use proxy by default (gonna remove later)
This commit is contained in:
parent
55487a90c3
commit
08cf4913eb
|
|
@ -105,7 +105,7 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
|
||||
late Client sendingClient;
|
||||
|
||||
Timeline? timeline;
|
||||
RoomTimeline? timeline;
|
||||
|
||||
late final String readMarkerEventId;
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ abstract class ClientManager {
|
|||
return Client(
|
||||
clientName,
|
||||
httpClient:
|
||||
PlatformInfos.isAndroid ? CustomHttpClient.createHTTPClient() : null,
|
||||
CustomHttpClient.createHTTPClient(),
|
||||
verificationMethods: {
|
||||
KeyVerificationMethod.numbers,
|
||||
if (kIsWeb || PlatformInfos.isMobile || PlatformInfos.isLinux)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:extera_next/utils/platform_infos.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/io_client.dart';
|
||||
|
||||
|
|
@ -10,20 +11,29 @@ class CustomHttpClient {
|
|||
static HttpClient customHttpClient(String? cert) {
|
||||
final context = SecurityContext.defaultContext;
|
||||
|
||||
try {
|
||||
if (cert != null) {
|
||||
final bytes = utf8.encode(cert);
|
||||
context.setTrustedCertificatesBytes(bytes);
|
||||
}
|
||||
} on TlsException catch (e) {
|
||||
if (e.osError != null &&
|
||||
e.osError!.message.contains('CERT_ALREADY_IN_HASH_TABLE')) {
|
||||
} else {
|
||||
rethrow;
|
||||
if (PlatformInfos.isAndroid) {
|
||||
try {
|
||||
if (cert != null) {
|
||||
final bytes = utf8.encode(cert);
|
||||
context.setTrustedCertificatesBytes(bytes);
|
||||
}
|
||||
} on TlsException catch (e) {
|
||||
if (e.osError != null &&
|
||||
e.osError!.message.contains('CERT_ALREADY_IN_HASH_TABLE')) {
|
||||
} else {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return HttpClient(context: context);
|
||||
// Use Nekoray mixed proxy
|
||||
// Made it for myself, remove later
|
||||
final httpClient = HttpClient(context: context);
|
||||
httpClient.findProxy = (uri) {
|
||||
return 'PROXY localhost:2080;';
|
||||
};
|
||||
|
||||
return httpClient;
|
||||
}
|
||||
|
||||
static http.Client createHTTPClient() => IOClient(customHttpClient(ISRG_X1));
|
||||
|
|
|
|||
10
pubspec.lock
10
pubspec.lock
|
|
@ -1201,12 +1201,10 @@ packages:
|
|||
matrix:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: main
|
||||
resolved-ref: "58c4cf19d010d9ae193e9df10bd1f8fdf02277b0"
|
||||
url: "https://git.extera.xyz/OfficialDakari/matrix-dart-sdk.git"
|
||||
source: git
|
||||
version: "2.0.1"
|
||||
path: "/home/officialdakari/repos/matrix-dart-sdk"
|
||||
relative: false
|
||||
source: path
|
||||
version: "3.0.1"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -65,9 +65,10 @@ dependencies:
|
|||
linkify: ^5.0.0
|
||||
material: ^1.0.0+2
|
||||
matrix:
|
||||
git:
|
||||
url: https://git.extera.xyz/OfficialDakari/matrix-dart-sdk.git
|
||||
ref: main
|
||||
path: /home/officialdakari/repos/matrix-dart-sdk
|
||||
# git:
|
||||
# url: https://git.extera.xyz/OfficialDakari/matrix-dart-sdk.git
|
||||
# ref: feature/threads
|
||||
mime: ^1.0.6
|
||||
native_imaging: ^0.2.0
|
||||
opus_caf_converter_dart: ^1.0.1
|
||||
|
|
|
|||
Loading…
Reference in New Issue