|
15 | 15 | import NIO |
16 | 16 | import NIOHTTP1 |
17 | 17 |
|
18 | | -/// Specifies the remote address of an HTTP proxy. |
19 | | -/// |
20 | | -/// Adding an `HTTPClientProxy` to your client's `HTTPClient.Configuration` |
21 | | -/// will cause requests to be passed through the specified proxy using the |
22 | | -/// HTTP `CONNECT` method. |
23 | | -/// |
24 | | -/// If a `TLSConfiguration` is used in conjunction with `HTTPClientProxy`, |
25 | | -/// TLS will be established _after_ successful proxy, between your client |
26 | | -/// and the destination server. |
27 | | -public extension HTTPClient { |
| 18 | +public extension HTTPClient.Configuration { |
| 19 | + /// Proxy server configuration |
| 20 | + /// Specifies the remote address of an HTTP proxy. |
| 21 | + /// |
| 22 | + /// Adding an `Proxy` to your client's `HTTPClient.Configuration` |
| 23 | + /// will cause requests to be passed through the specified proxy using the |
| 24 | + /// HTTP `CONNECT` method. |
| 25 | + /// |
| 26 | + /// If a `TLSConfiguration` is used in conjunction with `HTTPClient.Configuration.Proxy`, |
| 27 | + /// TLS will be established _after_ successful proxy, between your client |
| 28 | + /// and the destination server. |
28 | 29 | struct Proxy { |
29 | | - internal let host: String |
30 | | - internal let port: Int |
31 | | - |
| 30 | + /// Specifies Proxy server host. |
| 31 | + public var host: String |
| 32 | + /// Specifies Proxy server port. |
| 33 | + public var port: Int |
| 34 | + |
| 35 | + /// Create proxy. |
| 36 | + /// |
| 37 | + /// - parameters: |
| 38 | + /// - host: proxy server host. |
| 39 | + /// - port: proxy server port. |
32 | 40 | public static func server(host: String, port: Int) -> Proxy { |
33 | 41 | return .init(host: host, port: port) |
34 | 42 | } |
|
0 commit comments