We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f0eb2bf + 64b15ae commit 818bfb4Copy full SHA for 818bfb4
1 file changed
ruby/requests_proxy.rb
@@ -0,0 +1,16 @@
1
+require 'net/http'
2
+require 'uri'
3
+
4
+uri = URI('http://example.com')
5
+proxy_options = {
6
+ p_addr: 'PROXYHOST',
7
+ p_port: PORT,
8
+ # username/password are optional if you have IP authentication
9
+ p_user: 'USERNAME',
10
+ p_pass: 'PASSWORD',
11
+}
12
13
+Net::HTTP.start(uri.host, uri.port, **proxy_options) do |http|
14
+ request = Net::HTTP::Get.new uri
15
+ response = http.request request
16
+end
0 commit comments