excon 1.3.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 +15 -2
- data/data/cacert.pem +66 -665
- data/lib/excon/connection.rb +17 -0
- data/lib/excon/constants.rb +3 -0
- data/lib/excon/error.rb +1 -0
- data/lib/excon/middlewares/redirect_follower.rb +16 -4
- data/lib/excon/resolver_factory.rb +18 -0
- data/lib/excon/socket.rb +25 -41
- 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/test/plugin/server/webrick.rb +1 -1
- data/lib/excon/version.rb +1 -1
- data/lib/excon.rb +5 -2
- metadata +6 -3
- 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
|
@@ -213,6 +213,19 @@ dns_resolver = Resolv::DNS.new(nameserver: ['127.0.0.1'])
|
|
|
213
213
|
dns_resolver.timeouts = 3
|
|
214
214
|
resolver = Resolv.new([Resolv::Hosts.new, dns_resolver])
|
|
215
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
|
|
216
229
|
```
|
|
217
230
|
|
|
218
231
|
## Chunked Requests
|
|
@@ -311,10 +324,10 @@ s.close
|
|
|
311
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.
|
|
312
325
|
|
|
313
326
|
```ruby
|
|
314
|
-
connection = Excon.new('unix:///', :socket => '/tmp/
|
|
327
|
+
connection = Excon.new('unix:///', :socket => '/tmp/puma.sock')
|
|
315
328
|
connection.request(:method => :get, :path => '/ping')
|
|
316
329
|
|
|
317
|
-
Excon.get('unix:///ping', :socket => '/tmp/
|
|
330
|
+
Excon.get('unix:///ping', :socket => '/tmp/puma.sock')
|
|
318
331
|
```
|
|
319
332
|
|
|
320
333
|
NOTE: Proxies will be ignored when using a Unix socket, since a Unix socket has to be local.
|