lostisland / faraday-net_http Goto Github PK
View Code? Open in Web Editor NEWFaraday adapter for Net::HTTP
License: MIT License
Faraday adapter for Net::HTTP
License: MIT License
The Awesome Faraday repository identifies faraday-encoding as a useful middleware for forcing response encodings to match those sent by a server.
However, it seems as though following #13, this library conflicts with faraday-encoding and errors are thrown when they're both in use. Likely this is due to the following line (Encoding
in this case is unscoped, if the faraday-encoding library is loaded, there's a Faraday::Encoding
class that gets priority during this call):
NoMethodError:
undefined method `find' for Faraday::Encoding:Class
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:213:in `block in encoded_body'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:212:in `match'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:212:in `encoded_body'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:73:in `call'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-encoding-0.0.5/lib/faraday/encoding.rb:12:in `call'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/middleware.rb:17:in `call'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-detailed_logger-2.5.0/lib/faraday/detailed_logger/middleware/current.rb:55:in `call'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-follow_redirects-0.3.0/lib/faraday/follow_redirects/middleware.rb:77:in `perform_with_redirection'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-follow_redirects-0.3.0/lib/faraday/follow_redirects/middleware.rb:65:in `call'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/middleware.rb:17:in `call'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/middleware.rb:17:in `call'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/rack_builder.rb:153:in `build_response'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/connection.rb:445:in `run_request'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/connection.rb:281:in `post'
It seems that either this library needs to anchor the ::Encoding.find
call, identify that faraday-encoding is no longer useful, or find some other mechanism to avoid this issue.
Hey there,
I have updated one of my gems, via bundle update
and I reckon one of them gem use faraday gem as their dependency.
And now, everytime I run rspec or migration on my rails app, i have got these warnings
/usr/local/lib/ruby/2.7.0/net/protocol.rb:66: warning: already initialized constant Net::ProtocRetryError
/opt/app/vendor/bundle/ruby/2.7.0/gems/net-protocol-0.1.0/lib/net/protocol.rb:66: warning: previous definition of ProtocRetryError was here
/usr/local/lib/ruby/2.7.0/net/protocol.rb:206: warning: already initialized constant Net::BufferedIO::BUFSIZE
/opt/app/vendor/bundle/ruby/2.7.0/gems/net-protocol-0.1.0/lib/net/protocol.rb:206: warning: previous definition of BUFSIZE was here
/usr/local/lib/ruby/2.7.0/net/protocol.rb:503: warning: already initialized constant Net::NetPrivate::Socket
/opt/app/vendor/bundle/ruby/2.7.0/gems/net-protocol-0.1.0/lib/net/protocol.rb:503: warning: previous definition of Socket was here
I found out a comment in here: ruby/net-imap#16 (comment)
I wonder whether that will fix this issue.
Thanks
faraday-net_http/faraday-net_http.gemspec
Line 27 in 1b926b2
The gemspec declares faraday as a development dependency, but not a runtime one. Effectively this will allow this gem to be installed with any version of Faraday, even pre-1.0 versions.
Normally this won't cause problems, but if this gem appears earlier in your Gemfile than Faraday itself or another dependency that relies on Faraday, then you can get errors because the call to register_middleware
in
NoMethodError:
undefined method `register_middleware' for Faraday::Adapter:Class
Faraday::Adapter.register_middleware(net_http: Faraday::Adapter::NetHttp)
Can we do it for Net::HTTP
?
I found #finish
method, but not sure it's suitable.
Hey guys,
In 3.1.something ignore_eof
option was added to Net::HTTP
ruby/net-http#15 to fix a bug where EOFError
gets swallowed: https://bugs.ruby-lang.org/issues/14972
I modified the code from the bug report a bit to provide a reproducible env. In the client code, there are 3 clients:
faraday-net_http
adapter that swallows an errorfaraday-excon
adapter which raises an errorfaraday-net_http
adapter that raises an errorImo, this option should be set by default to false
as it's probably the right thing to do. Especially that other adapter(s), at least excon, has a proper behaviour. But maybe setting this option to false
by default is a breaking change that would require a major version release? If so, I'd propose to make the option configurable via env
.
pseudo server code
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'webrick' # I'm not sure if it's installed by default anymore
end
server = WEBrick::HTTPServer.new :Port => 6000
trap 'INT' do
server.shutdown
end
server.mount_proc '/' do |req, res|
res.status = 200
res['Content-Type'] = 'text/plain'
str = "0123456789"
res.body = str
res['Content-Length'] = str.length + 1
end
server.start
client code
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'faraday', '~> 2.0'
gem 'faraday-excon', '~> 2.0'
gem 'faraday-net_http', '~> 3.0'
end
uri = URI("http://localhost:6000/")
# most recent net http, swallows an error
streamed = []
conn = Faraday.new(uri)
conn.get('/') do |req|
req.options.on_data = Proc.new do |chunk, overall_received_bytes, env|
puts "Received #{overall_received_bytes} characters"
streamed << chunk
end
end
streamed.join
# ------
# most recent excon, raises an error (Faraday::ConnectionFailed)
# uncomment this and comment out earlier net http version
# streamed = []
# conn = Faraday.new(uri) do |f|
# f.adapter :excon
# end
# conn.get('/') do |req|
# req.options.on_data = Proc.new do |chunk, overall_received_bytes, env|
# puts "Received #{overall_received_bytes} characters"
# streamed << chunk
# end
# end
# streamed.join
# -----
# a patched version, raises an error (Faraday::ConnectionFailed)
# uncomment this and comment out earlier excon version
# module AdapterPatch
# def build_connection(env)
# http = super
# http.ignore_eof = false
# http
# end
# end
# Faraday::Adapter::NetHttp.prepend(AdapterPatch)
# streamed = []
# conn = Faraday.new(uri)
# conn.get('/') do |req|
# req.options.on_data = Proc.new do |chunk, overall_received_bytes, env|
# puts "Received #{overall_received_bytes} characters"
# streamed << chunk
# end
# end
# streamed.join
I've run into this issue, and it looks like others have as well:
lostisland/faraday#139
lostisland/faraday#443
It would be easy to handle charset, at least on par with other adapters. What do you think? Happy to put together a PR if there's interest.
Just wanted to mention this problem with the example in the README.
Seems like this got carried over from another adapter (net_http_persistent
).
To reproduce:
irb(main):042:1* conn = Faraday.new do |f|
irb(main):043:2* f.adapter :net_http do |http|
irb(main):044:2* # yields Net::HTTP
irb(main):045:2* http.idle_timeout = 100
irb(main):046:3* http.verify_callback = lambda do |preverify, cert_store|
irb(main):047:3* # do something here...
irb(main):048:2* end
irb(main):049:1* end
irb(main):050:0> end
=>
#<Faraday::Connection:0x0000558447fe7970
...
irb(main):051:0>
irb(main):052:0> conn.get
Traceback (most recent call last):
...
1: from /home/dgutov/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:188:in `configure_request'
(irb):45:in `block (2 levels) in <main>': undefined method `idle_timeout=' for #<Net::HTTP :80 open=false> (NoMethodError)
When I run an application which includes this gem, I get the following:
/Users/xxx/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/net/protocol.rb:66: warning: already initialized constant Net::ProtocRetryError
/Users/xxx/.rvm/gems/ruby-2.7.5/gems/net-protocol-0.1.3/lib/net/protocol.rb:68: warning: previous definition of ProtocRetryError was here
/Users/xxx/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/net/protocol.rb:206: warning: already initialized constant Net::BufferedIO::BUFSIZE
/Users/xxx/.rvm/gems/ruby-2.7.5/gems/net-protocol-0.1.3/lib/net/protocol.rb:208: warning: previous definition of BUFSIZE was here
/Users/xxx/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/net/protocol.rb:503: warning: already initialized constant Net::NetPrivate::Socket
/Users/xxx/.rvm/gems/ruby-2.7.5/gems/net-protocol-0.1.3/lib/net/protocol.rb:504: warning: previous definition of Socket was here
After some debugging I have been able to trace it to faraday-net_http
:
7: from /Users/xxx/.rvm/gems/ruby-2.7.5/gems/faraday-net_http-2.0.3/lib/faraday/adapter/net_http.rb:4:in `require'
6: from /Users/xxx/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/net/https.rb:22:in `<top (required)>'
5: from /Users/xxx/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/net/https.rb:22:in `require_relative'
4: from /Users/xxx/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/net/http.rb:23:in `<top (required)>'
3: from /Users/xxx/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/net/http.rb:23:in `require_relative'
2: from /Users/xxx/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/net/protocol.rb:26:in `<top (required)>'
1: from /Users/xxx/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/net/protocol.rb:66:in `<module:Net>'
From what I understand is that Ruby 3.0 moves these dependencies from the standard lib into gems, and a such we need to require them. However Ruby 2.7 still has them in the standard lib, and thus we see the duplicate require.
Faraday always trusts the OpenSSL system root CAs, even when a :ca_file
or a :ca_path
are specified, eg to implement CA pinning, or to reduce the number of trusted certificates.
Faraday.new('https://www.google.com', ssl: { ca_file: '/not/used/by/google/ca.pem' }).get('/') # => #<Faraday::Response:0x007ffd580b19d8 ...
An error about server certificate certificate validation, because the website's certificate does not match the :ca_file
Within the net_http
adapter, ssl_cert_store
will create a certificate store that includes the OpenSSL system root CAs if :cert_store
is not specified:
https://github.com/lostisland/faraday/blob/master/lib/faraday/adapter/net_http.rb#L105
def ssl_cert_store(ssl)
return ssl[:cert_store] if ssl[:cert_store]
# Use the default cert store by default, i.e. system ca certs
cert_store = OpenSSL::X509::Store.new
cert_store.set_default_paths
cert_store
end
I would think that Faraday should only set a default :cert_store
if there is no :ca_file
, no :ca_path
, and no :cert_store
specified.
Connecting to a dead kubernetes service raises a Errno::EALREADY
Faraday.new('http://foo.bar.svc.cluster.local').get '/'
Faraday.new('http://truth-service-x.truth-service.svc.cluster.local').get '/ping'
/usr/lib/ruby/3.1.0/socket.rb:1214:in `__connect_nonblock': Failed to open TCP connection to truth-service-x.truth-service.svc.cluster.local:80 (Operation already in progress - connect(2) for 172.29.8.85:80) (Errno::EALREADY)
from /usr/lib/ruby/3.1.0/socket.rb:1214:in `connect_nonblock'
from /usr/lib/ruby/3.1.0/socket.rb:56:in `connect_internal'
from /usr/lib/ruby/3.1.0/socket.rb:137:in `connect'
from /usr/lib/ruby/3.1.0/socket.rb:642:in `block in tcp'
from /usr/lib/ruby/3.1.0/socket.rb:227:in `each'
from /usr/lib/ruby/3.1.0/socket.rb:227:in `foreach'
from /usr/lib/ruby/3.1.0/socket.rb:632:in `tcp'
from /usr/lib/ruby/3.1.0/net/http.rb:998:in `connect'
from /usr/lib/ruby/3.1.0/net/http.rb:976:in `do_start'
from /usr/lib/ruby/3.1.0/net/http.rb:965:in `start'
from /usr/bundle/ruby/3.1.0/gems/faraday-net_http-2.0.2/lib/faraday/adapter/net_http.rb:136:in `request_via_get_method'
from /usr/bundle/ruby/3.1.0/gems/faraday-net_http-2.0.2/lib/faraday/adapter/net_http.rb:127:in `request_with_wrapped_block'
from /usr/bundle/ruby/3.1.0/gems/faraday-net_http-2.0.2/lib/faraday/adapter/net_http.rb:120:in `perform_request'
from /usr/bundle/ruby/3.1.0/gems/faraday-net_http-2.0.2/lib/faraday/adapter/net_http.rb:65:in `block in call'
from /usr/bundle/ruby/3.1.0/gems/faraday-2.3.0/lib/faraday/adapter.rb:45:in `connection'
from /usr/bundle/ruby/3.1.0/gems/faraday-net_http-2.0.2/lib/faraday/adapter/net_http.rb:64:in `call'
... 23 levels...
/usr/lib/ruby/3.1.0/socket.rb:1214:in `__connect_nonblock': Operation already in progress - connect(2) for 172.29.8.85:80 (Errno::EALREADY)
from /usr/lib/ruby/3.1.0/socket.rb:1214:in `connect_nonblock'
from /usr/lib/ruby/3.1.0/socket.rb:56:in `connect_internal'
from /usr/lib/ruby/3.1.0/socket.rb:137:in `connect'
from /usr/lib/ruby/3.1.0/socket.rb:642:in `block in tcp'
from /usr/lib/ruby/3.1.0/socket.rb:227:in `each'
from /usr/lib/ruby/3.1.0/socket.rb:227:in `foreach'
from /usr/lib/ruby/3.1.0/socket.rb:632:in `tcp'
from /usr/lib/ruby/3.1.0/net/http.rb:998:in `connect'
from /usr/lib/ruby/3.1.0/net/http.rb:976:in `do_start'
from /usr/lib/ruby/3.1.0/net/http.rb:965:in `start'
from /usr/bundle/ruby/3.1.0/gems/faraday-net_http-2.0.2/lib/faraday/adapter/net_http.rb:136:in `request_via_get_method'
from /usr/bundle/ruby/3.1.0/gems/faraday-net_http-2.0.2/lib/faraday/adapter/net_http.rb:127:in `request_with_wrapped_block'
from /usr/bundle/ruby/3.1.0/gems/faraday-net_http-2.0.2/lib/faraday/adapter/net_http.rb:120:in `perform_request'
from /usr/bundle/ruby/3.1.0/gems/faraday-net_http-2.0.2/lib/faraday/adapter/net_http.rb:65:in `block in call'
from /usr/bundle/ruby/3.1.0/gems/faraday-2.3.0/lib/faraday/adapter.rb:45:in `connection'
from /usr/bundle/ruby/3.1.0/gems/faraday-net_http-2.0.2/lib/faraday/adapter/net_http.rb:64:in `call'
I am trying to send the array of chain certificates in the SSL hash but I cannot have an error when sending the request, to be honest, I am not sure if Faraday or the current version of faraday supports this SSL request
Create the Certificate array chain [OpenSSL::X509::Certificate, .... n]
Add in the SSL hash in the request
post = {...}
ssl = {
verify: true,
client_cert: [cert_1, cert_2, cert_3],
client_key: OpenSSL::PKey::RSA.new("Key_String")
}
headers = {
'Content-Type': 'application/json'
}
url = "https://demo.com/test"
response = JSON.parse(Faraday.new(url, ssl: ssl).send(:put, url, post.to_json, headers).body)
It seems that when timeout occurs, the error class will be different according to the adapter of Faraday as below. Is there any reason that the difference happens?
:net_http
as the adapter, you will get Faraday::ConnectionFailed
.Faraday.new(request: { timeout: 0.01 }){|f|f.adapter :net_http}.get("https://google.com:81/")
Traceback (most recent call last):
... 4 levels...
16: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/connection.rb:200:in `get'
15: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/connection.rb:445:in `run_request'
14: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/rack_builder.rb:153:in `build_response'
13: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:64:in `call'
12: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/adapter.rb:45:in `connection'
11: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:65:in `block in call'
10: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:120:in `perform_request'
9: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:127:in `request_with_wrapped_block'
8: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:136:in `request_via_get_method'
7: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/2.7.0/net/http.rb:932:in `start'
6: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/2.7.0/net/http.rb:943:in `do_start'
5: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/2.7.0/net/http.rb:958:in `connect'
4: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/timeout-0.3.0/lib/timeout.rb:186:in `timeout'
3: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/timeout-0.3.0/lib/timeout.rb:179:in `block in timeout'
2: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/2.7.0/net/http.rb:960:in `block in connect'
1: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/2.7.0/net/http.rb:960:in `open'
/Users/ham/.rbenv/versions/2.7.4/lib/ruby/2.7.0/net/http.rb:960:in `initialize': Failed to open TCP connection to google.com:81 (execution expired) (Net::OpenTimeout)
... 4 levels...
16: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/connection.rb:200:in `get'
15: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/connection.rb:445:in `run_request'
14: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/rack_builder.rb:153:in `build_response'
13: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:64:in `call'
12: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/adapter.rb:45:in `connection'
11: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:65:in `block in call'
10: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:120:in `perform_request'
9: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:127:in `request_with_wrapped_block'
8: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-net_http-2.0.1/lib/faraday/adapter/net_http.rb:136:in `request_via_get_method'
7: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/2.7.0/net/http.rb:932:in `start'
6: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/2.7.0/net/http.rb:943:in `do_start'
5: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/2.7.0/net/http.rb:958:in `connect'
4: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/timeout-0.3.0/lib/timeout.rb:186:in `timeout'
3: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/timeout-0.3.0/lib/timeout.rb:179:in `block in timeout'
2: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/2.7.0/net/http.rb:960:in `block in connect'
1: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/2.7.0/net/http.rb:960:in `open'
/Users/ham/.rbenv/versions/2.7.4/lib/ruby/2.7.0/net/http.rb:960:in `initialize': Failed to open TCP connection to google.com:81 (execution expired) (Faraday::ConnectionFailed)
:httpclient
as the adapter, you will get Faraday::TimeoutError
.Faraday.new(request: { timeout: 0.01 }){|f|f.adapter :httpclient}.get("https://google.com:81/")
Traceback (most recent call last):
... 8 levels...
16: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/adapter.rb:45:in `connection'
15: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-httpclient-2.0.1/lib/faraday/adapter/httpclient.rb:45:in `block in call'
14: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httpclient-2.8.3/lib/httpclient.rb:856:in `request'
13: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httpclient-2.8.3/lib/httpclient.rb:1014:in `do_request'
12: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httpclient-2.8.3/lib/httpclient.rb:1133:in `protect_keep_alive_disconnected'
11: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httpclient-2.8.3/lib/httpclient.rb:1019:in `block in do_request'
10: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httpclient-2.8.3/lib/httpclient.rb:1242:in `do_get_block'
9: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:177:in `query'
8: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:511:in `query'
7: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:748:in `connect'
6: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/timeout-0.3.0/lib/timeout.rb:186:in `timeout'
5: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/timeout-0.3.0/lib/timeout.rb:179:in `block in timeout'
4: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:752:in `block in connect'
3: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httpclient-2.8.3/lib/httpclient/ssl_socket.rb:21:in `create_socket'
2: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:611:in `create_socket'
1: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:611:in `new'
/Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:611:in `initialize': execution expired (HTTPClient::ConnectTimeoutError)
24: from /Users/ham/.rbenv/versions/2.7.4/bin/irb:23:in `<main>'
23: from /Users/ham/.rbenv/versions/2.7.4/bin/irb:23:in `load'
22: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/irb-1.5.0/exe/irb:11:in `<top (required)>'
5: from (irb):8:in `<main>'
4: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/connection.rb:200:in `get'
3: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/connection.rb:445:in `run_request'
2: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-2.2.0/lib/faraday/rack_builder.rb:153:in `build_response'
1: from /Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-httpclient-2.0.1/lib/faraday/adapter/httpclient.rb:37:in `call'
/Users/ham/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/faraday-httpclient-2.0.1/lib/faraday/adapter/httpclient.rb:59:in `rescue in call': Faraday::TimeoutError
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.