getReceiveR :: Handler master ()
getReceiveR = do
    Chat chan0 <- getYesod
    chan       <- liftIO $ dupChan chan0
    req        <- waiRequest
    res        <- liftResourceT $ eventSourceAppChan chan req
    let (stat, hs, src) = responseSource res

    -- for nginx reverse-proxying to work, we add the header X-Accel-Buffering
    sendWaiResponse $ ResponseSource stat (("X-Accel-Buffering", "no"):hs) src

-- | Provide a widget that the master site can embed on any page.
getReceiveR :: Handler master ()
getReceiveR = do
    Chat chan0 <- getYesod
    chan       <- liftIO $ dupChan chan0
    req        <- waiRequest
    res        <- liftResourceT $ eventSourceAppChan chan req
    let (stat, hs, src) = responseSource res

    -- for nginx reverse-proxying to work, we add the header X-Accel-Buffering
    sendWaiResponse $ ResponseSource stat (("X-Accel-Buffering", "no"):hs) src

-- | Provide a widget that the master site can embed on any page.
getReceiveR = do
    Chat chan0 <- getYesod
    chan       <- liftIO $ dupChan chan0
    req        <- waiRequest
    res        <- liftResourceT $ eventSourceAppChan chan req
    let (stat, hs, src) = responseSource res

    -- for nginx reverse-proxying to work, we add the header X-Accel-Buffering
    sendWaiResponse $ ResponseSource stat (("X-Accel-Buffering", "no"):hs) src

-- | Provide a widget that the master site can embed on any page.