         }
 
         // Return the first header we read when the socket was opened if the proxy command is not CONNECT.
-        if internalStatus == .waitingToForward && !isConnectCommand {
+        if readingStatus == .pendingFirstHeader {
             delegate?.didRead(data: currentHeader.toData(), from: self)
-            internalStatus = .readingContent
+            readingStatus = .readingContent
             return
         }
 
         switch scanner.nextAction {
         case .readContent(let length):
-            internalStatus = .readingContent
+            readingStatus = .readingContent
             if length > 0 {
                 socket.readDataTo(length: length)
             } else {
                 socket.readData()
             }
         case .readHeader:
-            internalStatus = .readingHeader
+            readingStatus = .readingHeader
             socket.readDataTo(data: Utils.HTTPData.DoubleCRLF)
         case .stop:
-            internalStatus = .stopped
+            readingStatus = .stopped
             disconnect()
         }
 


    private let scanner: HTTPStreamScanner = HTTPStreamScanner()

    private var internalStatus: HTTPProxyStatus = .invalid

    public var isConnectCommand = false

    public override var statusDescription: String {
        return "\(status) (\(internalStatus))"
    }

    /**

                return "invalid"
            case .readingFirstHeader:
                return "reading first header"
            case .pendingFirstHeader:
                return "waiting to send first header"
            case .readingHeader:
                return "reading header (forwarding)"
            case .readingContent:
