rest-client / rest-client

Simple HTTP and REST client for Ruby, inspired by microframework syntax for specifying actions.

Home Page:https://rubydoc.info/github/rest-client/rest-client/master

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connection refused if we replace Socket DNS with Resolv

khiav223577 opened this issue · comments

RestClient.get('http://localhost:3000') 
# => <RestClient::Response 200 "<!DOCTYPE h..."> 

If we replace Socket DNS with Resolv, a lib built in ruby 2.7, it will raise "Connection refused"

require 'resolv-replace' 
RestClient.get('http://localhost:3000/docs/yield') 
# Errno::ECONNREFUSED: Failed to open TCP connection to localhost:3000 (Connection refused - connect(2) for "::1" port 3000)

Still happens...