Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/AsyncHTTPClient/HTTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public class HTTPClient {
}
}

private func resolveAddress(request: Request, proxy: Proxy?) -> (host: String, port: Int) {
private func resolveAddress(request: Request, proxy: Configuration.Proxy?) -> (host: String, port: Int) {
switch self.configuration.proxy {
case .none:
return (request.host, request.port)
Expand Down
16 changes: 12 additions & 4 deletions Sources/AsyncHTTPClient/HTTPClientProxyHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,19 @@ import NIOHTTP1
/// If a `TLSConfiguration` is used in conjunction with `HTTPClientProxy`,
/// TLS will be established _after_ successful proxy, between your client
/// and the destination server.
public extension HTTPClient {
public extension HTTPClient.Configuration {
Comment thread
ianpartridge marked this conversation as resolved.
/// Proxy server configuration
struct Proxy {
internal let host: String
internal let port: Int

/// Specifies Proxy server host.
public var host: String
/// Specifies Proxy server port.
public var port: Int

/// Create proxy.
///
/// - parameters:
/// - host: proxy server host.
/// - port: proxy server port.
public static func server(host: String, port: Int) -> Proxy {
return .init(host: host, port: port)
}
Expand Down