From 692a20dab2c3110c8cdd782929c1d446ac7a8a46 Mon Sep 17 00:00:00 2001
From: Sergey Tarasov <dzirtusss@gmail.com>
Date: Fri, 3 Nov 2023 14:11:20 +0200
Subject: [PATCH 1/2] Change to libcurl-impersonate-chrome

---
 lib/ethon/curls/settings.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ethon/curls/settings.rb b/lib/ethon/curls/settings.rb
index 8c0161b..a29dcff 100644
--- a/lib/ethon/curls/settings.rb
+++ b/lib/ethon/curls/settings.rb
@@ -7,6 +7,6 @@ module Curl
     callback :debug_callback, [:pointer, :debug_info_type, :pointer, :size_t, :pointer], :int
     callback :progress_callback, [:pointer, :long_long, :long_long, :long_long, :long_long], :int
     ffi_lib_flags :now, :global
-    ffi_lib ['libcurl', 'libcurl.so.4']
+    ffi_lib ['libcurl-impersonate-chrome', 'libcurl-impersonate-chrome.so.4']
   end
 end

From 9a82ca4f17a8b17d54bc6a6a1b8ac9be3ddeebea Mon Sep 17 00:00:00 2001
From: Sergey Tarasov <dzirtusss@gmail.com>
Date: Mon, 6 Nov 2023 12:55:24 +0200
Subject: [PATCH 2/2] Make libs configurable

---
 lib/ethon/curls/settings.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ethon/curls/settings.rb b/lib/ethon/curls/settings.rb
index a29dcff..c6a9e14 100644
--- a/lib/ethon/curls/settings.rb
+++ b/lib/ethon/curls/settings.rb
@@ -7,6 +7,6 @@ module Curl
     callback :debug_callback, [:pointer, :debug_info_type, :pointer, :size_t, :pointer], :int
     callback :progress_callback, [:pointer, :long_long, :long_long, :long_long, :long_long], :int
     ffi_lib_flags :now, :global
-    ffi_lib ['libcurl-impersonate-chrome', 'libcurl-impersonate-chrome.so.4']
+    ffi_lib ENV.fetch('ETHON_CURL_LIBS', 'libcurl,libcurl.so.4').split(',')
   end
 end