|
4 | 4 | # Copyright, 2019-2024, by Samuel Williams. |
5 | 5 | # Copyright, 2021-2022, by Adam Daniels. |
6 | 6 |
|
7 | | -require 'async/io/host_endpoint' |
8 | | -require 'async/io/ssl_endpoint' |
9 | | -require 'async/io/ssl_socket' |
10 | | -require 'async/io/shared_endpoint' |
| 7 | +require 'io/endpoint' |
| 8 | +require 'io/endpoint/host_endpoint' |
| 9 | +require 'io/endpoint/ssl_endpoint' |
11 | 10 |
|
12 | 11 | require_relative 'protocol/http1' |
13 | 12 | require_relative 'protocol/https' |
14 | 13 |
|
15 | 14 | module Async |
16 | 15 | module HTTP |
17 | 16 | # Represents a way to connect to a remote HTTP server. |
18 | | - class Endpoint < Async::IO::Endpoint |
| 17 | + class Endpoint < ::IO::Endpoint::Generic |
19 | 18 | def self.parse(string, endpoint = nil, **options) |
20 | 19 | url = URI.parse(string).normalize |
21 | 20 |
|
@@ -164,7 +163,7 @@ def build_endpoint(endpoint = nil) |
164 | 163 |
|
165 | 164 | if secure? |
166 | 165 | # Wrap it in SSL: |
167 | | - return Async::IO::SSLEndpoint.new(endpoint, |
| 166 | + return ::IO::Endpoint::SSLEndpoint.new(endpoint, |
168 | 167 | ssl_context: self.ssl_context, |
169 | 168 | hostname: @url.hostname, |
170 | 169 | timeout: self.timeout, |
@@ -226,7 +225,7 @@ def tcp_options |
226 | 225 | end |
227 | 226 |
|
228 | 227 | def tcp_endpoint |
229 | | - Async::IO::Endpoint.tcp(self.hostname, port, **tcp_options) |
| 228 | + ::IO::Endpoint.tcp(self.hostname, port, **tcp_options) |
230 | 229 | end |
231 | 230 | end |
232 | 231 | end |
|
0 commit comments