async-dns 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/cloudflare.rb +26 -0
- data/lib/async/dns/server.rb +1 -1
- data/lib/async/dns/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63426837f51c6ded347b85d6595cec47546c105c505c227841b7a74d77143862
|
4
|
+
data.tar.gz: c4a40e84680c56bb3afac65e753f4a2c3a004e3b80c434375ac77db7f7028ce3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95910a00deba14a1cd7e17f6d0d6c8d141a1aa6dc0376b5dff74ac57b5e25877ac13ecf63f01fb7d7eda9d6e0a45bd49ef20a6202ed5b11e4c94377fc924ffc9
|
7
|
+
data.tar.gz: 1ba1956351a68c00d80f9f585f5592f74afed11b344e8352ce51544da2f36747a545b5b5123372c719d43f0708edcafbc6a27934e129504f55926402b052de90
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
gem 'async'
|
4
|
+
gem 'async-http'
|
5
|
+
gem 'trenni'
|
6
|
+
|
7
|
+
require 'async/reactor'
|
8
|
+
require 'async/http/client'
|
9
|
+
require 'async/http/url_endpoint'
|
10
|
+
|
11
|
+
require 'trenni/uri'
|
12
|
+
|
13
|
+
# Async.logger.level = Logger::DEBUG
|
14
|
+
|
15
|
+
endpoint = Async::HTTP::URLEndpoint.parse("https://cloudflare-dns.com/dns-query")
|
16
|
+
client = Async::HTTP::Client.new(endpoint)
|
17
|
+
|
18
|
+
Async::Reactor.run do |task|
|
19
|
+
request_uri = Trenni::URI(endpoint.url.request_uri, ct: "application/dns-json", name: "microsoft.com", type: "MX")
|
20
|
+
|
21
|
+
puts "GET #{request_uri}"
|
22
|
+
response = client.get(request_uri.to_s, {})
|
23
|
+
|
24
|
+
puts "#{response.status} #{response.version} #{response.headers.inspect}"
|
25
|
+
puts response.read.inspect
|
26
|
+
end
|
data/lib/async/dns/server.rb
CHANGED
data/lib/async/dns/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-dns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-io
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- README.md
|
110
110
|
- Rakefile
|
111
111
|
- async-dns.gemspec
|
112
|
+
- examples/cloudflare.rb
|
112
113
|
- lib/async/dns.rb
|
113
114
|
- lib/async/dns/chunked.rb
|
114
115
|
- lib/async/dns/extensions/resolv.rb
|