excon 0.109.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +21 -4
- data/data/cacert.pem +337 -914
- data/excon.gemspec +24 -17
- data/lib/excon/connection.rb +33 -11
- data/lib/excon/constants.rb +139 -126
- data/lib/excon/error.rb +3 -2
- data/lib/excon/middlewares/decompress.rb +17 -22
- data/lib/excon/middlewares/redirect_follower.rb +19 -7
- data/lib/excon/resolver_factory.rb +18 -0
- data/lib/excon/response.rb +4 -4
- data/lib/excon/socket.rb +32 -48
- data/lib/excon/socks5.rb +194 -0
- data/lib/excon/socks5_socket.rb +36 -0
- data/lib/excon/socks5_ssl_socket.rb +44 -0
- data/lib/excon/ssl_socket.rb +4 -3
- data/lib/excon/test/plugin/server/puma.rb +1 -1
- data/lib/excon/test/plugin/server/unicorn.rb +5 -5
- data/lib/excon/test/plugin/server/webrick.rb +1 -1
- data/lib/excon/test/server.rb +2 -7
- data/lib/excon/unix_socket.rb +1 -1
- data/lib/excon/utils.rb +39 -36
- data/lib/excon/version.rb +1 -1
- data/lib/excon.rb +45 -51
- metadata +52 -23
- data/lib/excon/middlewares/capture_cookies.rb +0 -32
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5fea894ca265007d66dbec2fcd785d793fff59080175f64c268208d225e32a70
|
|
4
|
+
data.tar.gz: bdfe0c227062cc7560e5c8ca9ec4b5dabca2365443b50ab378312a38fc3c73d3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3baf7973f3a75855cebac881fe5ff3bf28da851dc03900151454802cf2b57700dca2c08bf1f532fe43583ac27baa4e9b8fb0f66611bb3209e1a259e38e947a75
|
|
7
|
+
data.tar.gz: b087fedfedbfa0655eb2febab2705f2e699376ec6ec4974c42bd0d3dc55a068ccf7251b0b201f6e051c27b01334b2f1bea4d27cd6b1f5b7fea872b1401df40ae
|
data/README.md
CHANGED
|
@@ -4,8 +4,8 @@ Usable, fast, simple Ruby HTTP 1.1
|
|
|
4
4
|
|
|
5
5
|
Excon was designed to be simple, fast and performant. It works great as a general HTTP(s) client and is particularly well suited to usage in API clients.
|
|
6
6
|
|
|
7
|
-
[](https://
|
|
7
|
+
[](https://github.com/excon/excon/actions/workflows/ci.yml)
|
|
8
|
+
[](https://rubygems.org/gems/excon)
|
|
9
9
|
|
|
10
10
|
- [Getting Started](#getting-started)
|
|
11
11
|
- [Options](#options)
|
|
@@ -190,6 +190,9 @@ connection.request(:timeout => 0.1) # timeout if the entire request takes longer
|
|
|
190
190
|
#
|
|
191
191
|
connection = Excon.new('http://geemus.com/', :tcp_nodelay => true)
|
|
192
192
|
|
|
193
|
+
# opt-in to having Excon add a default port (http:80 and https:443)
|
|
194
|
+
connection = Excon.new('http://geemus.com/', :include_default_port => true)
|
|
195
|
+
|
|
193
196
|
# set longer connect_timeout (default is 60 seconds)
|
|
194
197
|
connection = Excon.new('http://geemus.com/', :connect_timeout => 360)
|
|
195
198
|
|
|
@@ -210,6 +213,19 @@ dns_resolver = Resolv::DNS.new(nameserver: ['127.0.0.1'])
|
|
|
210
213
|
dns_resolver.timeouts = 3
|
|
211
214
|
resolver = Resolv.new([Resolv::Hosts.new, dns_resolver])
|
|
212
215
|
connection = Excon.new('http://geemus.com', :resolv_resolver => resolver)
|
|
216
|
+
|
|
217
|
+
# As an global alternative for Excon, you can configure a custom resolver
|
|
218
|
+
# factory which produces new resolver instances, configured to your likings.
|
|
219
|
+
# This even works with Ruby Ractors!
|
|
220
|
+
class CustomResolverFactory
|
|
221
|
+
# @return [Resolv] the new resolver instance
|
|
222
|
+
def self.create_resolver
|
|
223
|
+
dns_resolver = Resolv::DNS.new(nameserver: ['127.0.0.1'])
|
|
224
|
+
dns_resolver.timeouts = 3
|
|
225
|
+
Resolv.new([Resolv::Hosts.new, dns_resolver])
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
Excon.defaults[:resolver_factory] = CustomResolverFactory
|
|
213
229
|
```
|
|
214
230
|
|
|
215
231
|
## Chunked Requests
|
|
@@ -308,10 +324,10 @@ s.close
|
|
|
308
324
|
The Unix socket will work for one-off requests and multiuse connections. A Unix socket path must be provided separate from the resource path.
|
|
309
325
|
|
|
310
326
|
```ruby
|
|
311
|
-
connection = Excon.new('unix:///', :socket => '/tmp/
|
|
327
|
+
connection = Excon.new('unix:///', :socket => '/tmp/puma.sock')
|
|
312
328
|
connection.request(:method => :get, :path => '/ping')
|
|
313
329
|
|
|
314
|
-
Excon.get('unix:///ping', :socket => '/tmp/
|
|
330
|
+
Excon.get('unix:///ping', :socket => '/tmp/puma.sock')
|
|
315
331
|
```
|
|
316
332
|
|
|
317
333
|
NOTE: Proxies will be ignored when using a Unix socket, since a Unix socket has to be local.
|
|
@@ -509,6 +525,7 @@ Either of these should allow you to work around the socket error and continue wi
|
|
|
509
525
|
|
|
510
526
|
## Getting Help
|
|
511
527
|
|
|
528
|
+
- We support and test-against non-EOL Ruby versions. If you need older version support, please reach out.
|
|
512
529
|
- Ask specific questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/excon).
|
|
513
530
|
- Report bugs and discuss potential features in [Github issues](https://github.com/excon/excon/issues).
|
|
514
531
|
|