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.
-
#auto_render_spa ⇒ Object
Returns the value of attribute auto_render_spa.
-
#auto_solve_waf ⇒ Object
WAF & JS challenge solving settings.
-
#binary_path ⇒ Object
Returns the value of attribute binary_path.
-
#cookie_store_dir ⇒ Object
Returns the value of attribute cookie_store_dir.
-
#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.
-
#navigation_headers ⇒ Object
Modern Navigation Headers simulation.
-
#obscura_github_repo ⇒ Object
Returns the value of attribute obscura_github_repo.
-
#obscura_path ⇒ Object
Returns the value of attribute obscura_path.
-
#obscura_version ⇒ Object
Obscura headless SPA engine settings.
-
#persist_cookies ⇒ Object
Shared Host-based CookieStore settings.
-
#qjs_github_repo ⇒ Object
Returns the value of attribute qjs_github_repo.
-
#qjs_version ⇒ Object
QuickJS standalone binary management 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.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/http_mimic/configuration.rb', line 49 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' # QuickJS defaults @qjs_version = 'v0.16.2' @qjs_github_repo = 'quickjs-ng/quickjs' # Obscura defaults (Lightweight Rust+V8 headless SPA engine) # Temporarily points to 'anxgang/obscura' (v0.2.3) for Web Worker importScripts support. # Will switch back to 'h4ckf0r0day/obscura' once upstream Pull Request is merged. # @obscura_github_repo = 'h4ckf0r0day/obscura' @obscura_version = 'v0.2.3' @obscura_github_repo = 'anxgang/obscura' @obscura_path = nil @auto_render_spa = false # WAF challenge solving defaults @auto_solve_waf = true # Shared Host CookieStore defaults @persist_cookies = false @cookie_store_dir = File.('~/.http_mimic/cookies') # Navigation Headers defaults @navigation_headers = true 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 |
#auto_render_spa ⇒ Object
Returns the value of attribute auto_render_spa.
37 38 39 |
# File 'lib/http_mimic/configuration.rb', line 37 def auto_render_spa @auto_render_spa end |
#auto_solve_waf ⇒ Object
WAF & JS challenge solving settings
40 41 42 |
# File 'lib/http_mimic/configuration.rb', line 40 def auto_solve_waf @auto_solve_waf 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 |
#cookie_store_dir ⇒ Object
Returns the value of attribute cookie_store_dir.
44 45 46 |
# File 'lib/http_mimic/configuration.rb', line 44 def @cookie_store_dir 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 |
#navigation_headers ⇒ Object
Modern Navigation Headers simulation
47 48 49 |
# File 'lib/http_mimic/configuration.rb', line 47 def @navigation_headers end |
#obscura_github_repo ⇒ Object
Returns the value of attribute obscura_github_repo.
35 36 37 |
# File 'lib/http_mimic/configuration.rb', line 35 def obscura_github_repo @obscura_github_repo end |
#obscura_path ⇒ Object
Returns the value of attribute obscura_path.
36 37 38 |
# File 'lib/http_mimic/configuration.rb', line 36 def obscura_path @obscura_path end |
#obscura_version ⇒ Object
Obscura headless SPA engine settings
34 35 36 |
# File 'lib/http_mimic/configuration.rb', line 34 def obscura_version @obscura_version end |
#persist_cookies ⇒ Object
Shared Host-based CookieStore settings
43 44 45 |
# File 'lib/http_mimic/configuration.rb', line 43 def @persist_cookies end |
#qjs_github_repo ⇒ Object
Returns the value of attribute qjs_github_repo.
31 32 33 |
# File 'lib/http_mimic/configuration.rb', line 31 def qjs_github_repo @qjs_github_repo end |
#qjs_version ⇒ Object
QuickJS standalone binary management settings
30 31 32 |
# File 'lib/http_mimic/configuration.rb', line 30 def qjs_version @qjs_version 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 |