Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Net::HTTP#ipaddr=
ipaddr=(addr)
lib/net/http.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/net/http.rb, line 1286
def ipaddr=(addr)
raise IOError, "ipaddr value changed, but session already started" if started?
@ipaddr = addr
end
Sets the IP address for the connection:
Example
http = Net::HTTP.new(hostname) http.ipaddr # => nil http.ipaddr = '172.67.155.76' http.ipaddr # => "172.67.155.76"
The IP address may not be set if the session has been started.