 // SOFTWARE.
 
 @_exported import TCPSSL
-@_exported import HTTP
 @_exported import HTTPParser
 @_exported import HTTPSerializer
+
+public enum ClientError: ErrorProtocol {
+    case hostRequired
+    case portRequired
+}
 
 public final class Client: Responder {
     public let host: String

        var request = request
        addHeaders(&request)

        let stream: Stream = try connection ?? TCPSSLConnection(to: host, on: port, verifyBundle: verifyBundle, certificate: certificate, privateKey: privateKey, certificateChain: certificateChain)

        try serializer.serialize(request, to: stream)

        while true {
            let data = try stream.receive(upTo: 1024)
            if let response = try parser.parse(data)  {

                if let upgrade = request.upgrade {
                    try upgrade(response, stream)
                }

                if !keepAlive {
                    connection = nil
                }

                return response

        self.parser = parser
        self.keepAlive = keepAlive
    }

    public convenience init(uri: String, verifyBundle: String? = nil, certificate: String? = nil, privateKey: String? = nil, certificateChain: String? = nil, serializer: S4.RequestSerializer = RequestSerializer(), parser: S4.ResponseParser = ResponseParser(), keepAlive: Bool = false) throws {
        try self.init(uri: URI(uri), verifyBundle: verifyBundle, certificate: certificate, privateKey: privateKey, certificateChain: certificateChain, serializer: serializer, parser: parser, keepAlive: keepAlive)
    }
}

extension Client {
    private func addHeaders(_ request: inout Request) {
        var request = request
        request.host = "\(host):\(port)"
        request.userAgent = "Zewo"
