I am testing the use of proxy with Net::HTTP in Ruby and found out that I keep getting 301 redirect with the code even though I type the address in the url correctly. With the same URI object the code works if I use get_response() but doesn't work if I use the below method. Not sure what went wrong there? Thanks!
Edit: This does not seem to be a 301 follow issue. It seems like something related to https but not sure how to navigate it.
proxy_addr = nil
proxy_port = nil
url = URI("https://www.bloomberg.com/asia")
Net::HTTP.new('www.bloomberg.com', nil, proxy_addr, proxy_port).start { |http|
res = http.get(url)
puts res.code
puts res.message
puts res.header['location']
}