lib/async/http/endpoint.rb in async-http-0.64.2 vs lib/async/http/endpoint.rb in async-http-0.65.0
- old
+ new
@@ -1,23 +1,22 @@
# frozen_string_literal: true
# Released under the MIT License.
-# Copyright, 2019-2023, by Samuel Williams.
+# Copyright, 2019-2024, by Samuel Williams.
# Copyright, 2021-2022, by Adam Daniels.
-require 'async/io/host_endpoint'
-require 'async/io/ssl_endpoint'
-require 'async/io/ssl_socket'
-require 'async/io/shared_endpoint'
+require 'io/endpoint'
+require 'io/endpoint/host_endpoint'
+require 'io/endpoint/ssl_endpoint'
require_relative 'protocol/http1'
require_relative 'protocol/https'
module Async
module HTTP
# Represents a way to connect to a remote HTTP server.
- class Endpoint < Async::IO::Endpoint
+ class Endpoint < ::IO::Endpoint::Generic
def self.parse(string, endpoint = nil, **options)
url = URI.parse(string).normalize
return self.new(url, endpoint, **options)
end
@@ -162,11 +161,11 @@
def build_endpoint(endpoint = nil)
endpoint ||= tcp_endpoint
if secure?
# Wrap it in SSL:
- return Async::IO::SSLEndpoint.new(endpoint,
+ return ::IO::Endpoint::SSLEndpoint.new(endpoint,
ssl_context: self.ssl_context,
hostname: @url.hostname,
timeout: self.timeout,
)
end
@@ -224,10 +223,10 @@
return options
end
def tcp_endpoint
- Async::IO::Endpoint.tcp(self.hostname, port, **tcp_options)
+ ::IO::Endpoint.tcp(self.hostname, port, **tcp_options)
end
end
end
end