mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-11-22 00:05:57 -05:00
21 lines
299 B
Ruby
21 lines
299 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "resolv"
|
|
require_relative "test"
|
|
|
|
# from https://gist.github.com/peterc/1425383
|
|
|
|
class SlowDNSServer < TestDNSResolver
|
|
def initialize(timeout)
|
|
@timeout = timeout
|
|
super()
|
|
end
|
|
|
|
private
|
|
|
|
def dns_response(*)
|
|
sleep(@timeout)
|
|
super
|
|
end
|
|
end
|