         return headers
     }
 
-    init(request: Request, socket: Socket) {
+    init(request: Request, responder: Responder, socket: Socket) {
         self.request = request
         self.status = .OK
         self.contentType = .Text
         self.body = []
+        self.responder = responder
         self.socket = socket
     }
 }


    public func send() {
        
        defer {
//            Session.close(request: request, response: self)
            socket.release()
        }
        
        do {
            try socket.writeUTF8("HTTP/1.1 \(status.code) \(reasonPhrase)\r\n")
            
            var headers = self.headers()
            
            if body.count >= 0 {
                headers["Content-Length"] = "\(body.count)"
            }
            
            if true && body.count != -1 {
                headers["Connection"] = "keep-alive"
            }
            
            for (name, value) in headers {
                try socket.writeUTF8("\(name): \(value)\r\n")
            }
            
            try socket.writeUTF8("\r\n")
            
            try socket.writeUInt8(body)
            
        } catch {
            print(error)
        }
    }

    public func send(text text: String) {

        }

        switch self.contentType {
        case .JSON:
            headers["Content-Type"] = "application/json"
        case .HTML:
            headers["Content-Type"] = "text/html"
        default:
            break
