app :: Client.Manager -> Chan (LocalTime,Request) -> String -> Int -> Application
app man logChan hostname port = \request respond -> do
                                                t <- getZonedTime
                                                writeChan logChan (zonedTimeToLocalTime t, request)
                                                case requestMethod request of
                                                   "GET" ->  processResponse respond $ getRequest man request (buildRequestUrl request hostname port)
                                                   "POST" -> processResponse respond $ postRequest man request (buildRequestUrl request hostname port)
                                                   "CONNECT" -> respond $ tunnel (requestHeaderHost request)
                                                   _ -> respond $ responseLBS
                                                                    status405
                                                                    [("Content-Type", "text/plain")]
                                                                    "405 Method not supported" 
app :: Client.Manager -> Chan (LocalTime,Request) -> String -> Int -> Application
app man logChan hostname port = \request respond -> do
                                                t <- getZonedTime
                                                writeChan logChan (zonedTimeToLocalTime t, request)
                                                case requestMethod request of
                                                   "GET" ->  processResponse respond $ getRequest man request (buildRequestUrl request hostname port)
                                                   "POST" -> processResponse respond $ postRequest man request (buildRequestUrl request hostname port)
                                                   "CONNECT" -> respond $ tunnel (requestHeaderHost request)
                                                   _ -> respond $ responseLBS
                                                                    status405
                                                                    [("Content-Type", "text/plain")]
                                                                    "405 Method not supported" 
app man logChan hostname port = \request respond -> do
                                                t <- getZonedTime
                                                writeChan logChan (zonedTimeToLocalTime t, request)
                                                case requestMethod request of
                                                   "GET" ->  processResponse respond $ getRequest man request (buildRequestUrl request hostname port)
                                                   "POST" -> processResponse respond $ postRequest man request (buildRequestUrl request hostname port)
                                                   "CONNECT" -> respond $ tunnel (requestHeaderHost request)
                                                   _ -> respond $ responseLBS
                                                                    status405
                                                                    [("Content-Type", "text/plain")]
                                                                    "405 Method not supported" 