Class: ScanOptions
- Inherits:
-
Object
- Object
- ScanOptions
- Defined in:
- lib/fingerprinter/configs/scan_options.rb
Overview
This class builds and maintains the list of options provided for the scan to make it available when needed
Class Method Summary collapse
- .build(options) ⇒ Object
- .http_concurrency ⇒ Object
- .proxy? ⇒ Boolean
- .proxy_host ⇒ Object
- .proxy_port ⇒ Object
- .proxy_url ⇒ Object
- .silent? ⇒ Boolean
- .timeout ⇒ Object
- .user_agent ⇒ Object
Class Method Details
.build(options) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/fingerprinter/configs/scan_options.rb', line 6 def self.build() @proxy = [:proxy] @user_agent = [:ua] @timeout = [:timeout] @concurrency = [:concurrency] @silent = [:silent] end |
.http_concurrency ⇒ Object
44 45 46 |
# File 'lib/fingerprinter/configs/scan_options.rb', line 44 def self.http_concurrency @concurrency || 20 end |
.proxy? ⇒ Boolean
14 15 16 |
# File 'lib/fingerprinter/configs/scan_options.rb', line 14 def self.proxy? !!@proxy end |
.proxy_host ⇒ Object
18 19 20 21 22 23 |
# File 'lib/fingerprinter/configs/scan_options.rb', line 18 def self.proxy_host uri = URI(@proxy) return '' unless uri uri.host.to_s end |
.proxy_port ⇒ Object
29 30 31 32 33 34 |
# File 'lib/fingerprinter/configs/scan_options.rb', line 29 def self.proxy_port uri = URI(@proxy) return nil unless uri uri.port.to_s end |
.proxy_url ⇒ Object
25 26 27 |
# File 'lib/fingerprinter/configs/scan_options.rb', line 25 def self.proxy_url @proxy end |
.silent? ⇒ Boolean
48 49 50 |
# File 'lib/fingerprinter/configs/scan_options.rb', line 48 def self.silent? !!@silent end |
.timeout ⇒ Object
40 41 42 |
# File 'lib/fingerprinter/configs/scan_options.rb', line 40 def self.timeout @timeout ? @timeout.to_i : 10 end |
.user_agent ⇒ Object
36 37 38 |
# File 'lib/fingerprinter/configs/scan_options.rb', line 36 def self.user_agent @user_agent || 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36' end |