File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,6 +101,10 @@ parser = OptionParser.new do |o|
101101
102102 o . on ( "-x" , "--proxy URL" , "Proxy URL (e.g. http://host:port)" ) { |p | cfg [ :proxy ] = p }
103103
104+ o . on ( "--local-address IP" , "Bind outgoing connections to this source IP address" ) do |ip |
105+ cfg [ :local_address ] = ip
106+ end
107+
104108 o . on ( "--timeout SECS" , Float , "Total timeout in seconds" ) { |t | cfg [ :timeout ] = t }
105109 o . on ( "--connect-timeout SECS" , Float , "Connection timeout in seconds" ) { |t | cfg [ :connect_timeout ] = t }
106110
154158cfg [ :method ] ||= "GET"
155159
156160# Build Wreq::Client options (connection/emulation settings only)
157- CLIENT_KEYS = %i[ emulation emulation_os user_agent proxy timeout connect_timeout
161+ CLIENT_KEYS = %i[ emulation emulation_os user_agent proxy local_address timeout connect_timeout
158162 http1_only http2_only cookie_store https_only ] . freeze
159163client_opts = cfg . slice ( *CLIENT_KEYS ) . reject { |_ , v | v . nil? }
160164client_opts [ :redirect ] = cfg [ :redirect ]
You can’t perform that action at this time.
0 commit comments