Class: SocksProxyPatch
- Inherits:
-
Object
- Object
- SocksProxyPatch
- Defined in:
- lib/train-winrm/socks_proxy_patch.rb
Class Method Summary collapse
-
.apply(socks_proxy:, socks_user: nil, socks_password: nil) ⇒ Object
Applies the SOCKS proxy settings to ‘HTTPClient` and `TCPSocket`.
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(socks_proxy:, socks_user:, socks_password:) ⇒ SocksProxyPatch
constructor
A new instance of SocksProxyPatch.
Constructor Details
#initialize(socks_proxy:, socks_user:, socks_password:) ⇒ SocksProxyPatch
Returns a new instance of SocksProxyPatch.
25 26 27 28 29 |
# File 'lib/train-winrm/socks_proxy_patch.rb', line 25 def initialize(socks_proxy:, socks_user:, socks_password:) @socks_proxy = socks_proxy @socks_user = socks_user @socks_password = socks_password end |
Class Method Details
.apply(socks_proxy:, socks_user: nil, socks_password: nil) ⇒ Object
Applies the SOCKS proxy settings to ‘HTTPClient` and `TCPSocket`.
21 22 23 |
# File 'lib/train-winrm/socks_proxy_patch.rb', line 21 def self.apply(socks_proxy:, socks_user: nil, socks_password: nil) new(socks_proxy: socks_proxy, socks_user: socks_user, socks_password: socks_password).apply end |
Instance Method Details
#apply ⇒ Object
31 32 33 34 35 |
# File 'lib/train-winrm/socks_proxy_patch.rb', line 31 def apply @proxy_host, @proxy_port = parse_and_validate_proxy(@socks_proxy) configure_socks patch_http_client end |