getDataFrom :: String -> IO String
getDataFrom filepath = do
    hostAddress <- inet_addr "127.0.0.1"
    let sockAddr = SockAddrInet 9000 hostAddress
    -- Create a socket
    sock <- socket AF_INET Stream defaultProtocol
    -- Connect to server
    connect sock sockAddr
    let fisrt = [ '\1', '\1', '\0', '\0', '\0', '\8', '\0', '\0'
                , '\0', '\1', '\0', '\0', '\0', '\0', '\0', '\0'
                ]
    let nameParis =
            [ ("GATEWAY_INTERFACE", "FastCGI/1.0")
            , ("REQUEST_METHOD", "GET")
            , ("SCRIPT_FILENAME", filepath)
            , ("SERVER_PORT", "8080")
            ]
    let params = toNameValuePairs nameParis
    let params_len =  length params
    let params_padding_len = (8 - params_len `mod` 8)
    let second = ['\1', '\4', '\0', '\1'] ++ showContentLength params_len ++ showPaddingLength params_padding_len ++ ['\0']
    let second' = params ++ replicate params_padding_len '\0'
    let third = ['\1', '\4', '\0', '\1', '\0', '\0', '\0', '\0']
    let four = ['\1', '\5', '\0', '\1', '\0', '\0', '\0', '\0']
    let request = [fisrt, second, second', third, four]
    print $ map length request
    send sock $ concat request
    s <- parseFastCGIRecord sock
    sClose sock
    return s
getDataFrom :: String -> IO String
getDataFrom filepath = do
    hostAddress <- inet_addr "127.0.0.1"
    let sockAddr = SockAddrInet 9000 hostAddress
    -- Create a socket
    sock <- socket AF_INET Stream defaultProtocol
    -- Connect to server
    connect sock sockAddr
    let fisrt = [ '\1', '\1', '\0', '\0', '\0', '\8', '\0', '\0'
                , '\0', '\1', '\0', '\0', '\0', '\0', '\0', '\0'
                ]
    let nameParis =
            [ ("GATEWAY_INTERFACE", "FastCGI/1.0")
            , ("REQUEST_METHOD", "GET")
            , ("SCRIPT_FILENAME", filepath)
            , ("SERVER_PORT", "8080")
            ]
    let params = toNameValuePairs nameParis
    let params_len =  length params
    let params_padding_len = (8 - params_len `mod` 8)
    let second = ['\1', '\4', '\0', '\1'] ++ showContentLength params_len ++ showPaddingLength params_padding_len ++ ['\0']
    let second' = params ++ replicate params_padding_len '\0'
    let third = ['\1', '\4', '\0', '\1', '\0', '\0', '\0', '\0']
    let four = ['\1', '\5', '\0', '\1', '\0', '\0', '\0', '\0']
    let request = [fisrt, second, second', third, four]
    print $ map length request
    send sock $ concat request
    s <- parseFastCGIRecord sock
    sClose sock
    return s
getDataFrom filepath = do
    hostAddress <- inet_addr "127.0.0.1"
    let sockAddr = SockAddrInet 9000 hostAddress
    -- Create a socket
    sock <- socket AF_INET Stream defaultProtocol
    -- Connect to server
    connect sock sockAddr
    let fisrt = [ '\1', '\1', '\0', '\0', '\0', '\8', '\0', '\0'
                , '\0', '\1', '\0', '\0', '\0', '\0', '\0', '\0'
                ]
    let nameParis =
            [ ("GATEWAY_INTERFACE", "FastCGI/1.0")
            , ("REQUEST_METHOD", "GET")
            , ("SCRIPT_FILENAME", filepath)
            , ("SERVER_PORT", "8080")
            ]
    let params = toNameValuePairs nameParis
    let params_len =  length params
    let params_padding_len = (8 - params_len `mod` 8)
    let second = ['\1', '\4', '\0', '\1'] ++ showContentLength params_len ++ showPaddingLength params_padding_len ++ ['\0']
    let second' = params ++ replicate params_padding_len '\0'
    let third = ['\1', '\4', '\0', '\1', '\0', '\0', '\0', '\0']
    let four = ['\1', '\5', '\0', '\1', '\0', '\0', '\0', '\0']
    let request = [fisrt, second, second', third, four]
    print $ map length request
    send sock $ concat request
    s <- parseFastCGIRecord sock
    sClose sock
    return s