Class: HttpMimic::Configuration
- Inherits:
-
Object
- Object
- HttpMimic::Configuration
- Defined in:
- lib/http_mimic/configuration.rb
Instance Attribute Summary collapse
-
#auto_download ⇒ Object
Webdrivers-like auto download and driver management settings.
-
#auto_fallback ⇒ Object
Returns the value of attribute auto_fallback.
-
#binary_path ⇒ Object
Returns the value of attribute binary_path.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#default_connect_timeout ⇒ Object
Returns the value of attribute default_connect_timeout.
-
#default_impersonate ⇒ Object
Browser simulation & request defaults.
-
#default_mobile_impersonate ⇒ Object
Returns the value of attribute default_mobile_impersonate.
-
#default_timeout ⇒ Object
Returns the value of attribute default_timeout.
-
#driver_version ⇒ Object
Returns the value of attribute driver_version.
-
#fallback_to_curl ⇒ Object
Returns the value of attribute fallback_to_curl.
-
#follow_redirects ⇒ Object
Returns the value of attribute follow_redirects.
-
#github_repo ⇒ Object
Returns the value of attribute github_repo.
-
#install_dir ⇒ Object
Returns the value of attribute install_dir.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#max_redirects ⇒ Object
Returns the value of attribute max_redirects.
-
#mode ⇒ Object
Multi-strategy and smart auto-fallback settings.
-
#raise_on_error ⇒ Object
Returns the value of attribute raise_on_error.
-
#retry_statuses ⇒ Object
Returns the value of attribute retry_statuses.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/http_mimic/configuration.rb', line 29 def initialize @default_impersonate = 'chrome131' @default_mobile_impersonate = 'safari180_ios' @binary_path = nil @fallback_to_curl = true @default_timeout = 30 @default_connect_timeout = 10 @follow_redirects = true @max_redirects = 10 @raise_on_error = false @logger = nil @debug = false # Multi-strategy defaults: :auto seamlessly falls back between impersonate, mobile, and curl @mode = :auto @auto_fallback = true @retry_statuses = [403, 429, 503] # Enable automatic downloading of curl-impersonate driver (lexiforest) by default @auto_download = true @driver_version = 'v2.1.1' @install_dir = File.('~/.http_mimic/bin') @github_repo = 'lexiforest/curl-impersonate' end |
Instance Attribute Details
#auto_download ⇒ Object
Webdrivers-like auto download and driver management settings
24 25 26 |
# File 'lib/http_mimic/configuration.rb', line 24 def auto_download @auto_download end |
#auto_fallback ⇒ Object
Returns the value of attribute auto_fallback.
20 21 22 |
# File 'lib/http_mimic/configuration.rb', line 20 def auto_fallback @auto_fallback end |
#binary_path ⇒ Object
Returns the value of attribute binary_path.
8 9 10 |
# File 'lib/http_mimic/configuration.rb', line 8 def binary_path @binary_path end |
#debug ⇒ Object
Returns the value of attribute debug.
16 17 18 |
# File 'lib/http_mimic/configuration.rb', line 16 def debug @debug end |
#default_connect_timeout ⇒ Object
Returns the value of attribute default_connect_timeout.
11 12 13 |
# File 'lib/http_mimic/configuration.rb', line 11 def default_connect_timeout @default_connect_timeout end |
#default_impersonate ⇒ Object
Browser simulation & request defaults
6 7 8 |
# File 'lib/http_mimic/configuration.rb', line 6 def default_impersonate @default_impersonate end |
#default_mobile_impersonate ⇒ Object
Returns the value of attribute default_mobile_impersonate.
7 8 9 |
# File 'lib/http_mimic/configuration.rb', line 7 def default_mobile_impersonate @default_mobile_impersonate end |
#default_timeout ⇒ Object
Returns the value of attribute default_timeout.
10 11 12 |
# File 'lib/http_mimic/configuration.rb', line 10 def default_timeout @default_timeout end |
#driver_version ⇒ Object
Returns the value of attribute driver_version.
25 26 27 |
# File 'lib/http_mimic/configuration.rb', line 25 def driver_version @driver_version end |
#fallback_to_curl ⇒ Object
Returns the value of attribute fallback_to_curl.
9 10 11 |
# File 'lib/http_mimic/configuration.rb', line 9 def fallback_to_curl @fallback_to_curl end |
#follow_redirects ⇒ Object
Returns the value of attribute follow_redirects.
12 13 14 |
# File 'lib/http_mimic/configuration.rb', line 12 def follow_redirects @follow_redirects end |
#github_repo ⇒ Object
Returns the value of attribute github_repo.
27 28 29 |
# File 'lib/http_mimic/configuration.rb', line 27 def github_repo @github_repo end |
#install_dir ⇒ Object
Returns the value of attribute install_dir.
26 27 28 |
# File 'lib/http_mimic/configuration.rb', line 26 def install_dir @install_dir end |
#logger ⇒ Object
Returns the value of attribute logger.
15 16 17 |
# File 'lib/http_mimic/configuration.rb', line 15 def logger @logger end |
#max_redirects ⇒ Object
Returns the value of attribute max_redirects.
13 14 15 |
# File 'lib/http_mimic/configuration.rb', line 13 def max_redirects @max_redirects end |
#mode ⇒ Object
Multi-strategy and smart auto-fallback settings
19 20 21 |
# File 'lib/http_mimic/configuration.rb', line 19 def mode @mode end |
#raise_on_error ⇒ Object
Returns the value of attribute raise_on_error.
14 15 16 |
# File 'lib/http_mimic/configuration.rb', line 14 def raise_on_error @raise_on_error end |
#retry_statuses ⇒ Object
Returns the value of attribute retry_statuses.
21 22 23 |
# File 'lib/http_mimic/configuration.rb', line 21 def retry_statuses @retry_statuses end |