import 'dart:io';

class CustomHttpClient {
  static HttpClient createWithTimeout({
    Duration connectionTimeout = const Duration(seconds: 10),
    Duration receiveTimeout = const Duration(seconds: 30),
  }) {
    final client = HttpClient();

    client.connectionTimeout = connectionTimeout;

    client.idleTimeout = const Duration(seconds: 15);

    client.badCertificateCallback = (cert, host, port) {
      return false;
    };

    return client;
  }
}
