webapp: Work around bug in Warp's slowloris attack prevention code, that caused regular browsers to stall when they reuse a connection after leaving it idle for 30 seconds. (See https://github.com/yesodweb/wai/issues/146)
This commit is contained in:
parent
0155f1effa
commit
3e32bb41f6
3 changed files with 12 additions and 1 deletions
|
@ -56,9 +56,14 @@ browserCommand = "xdg-open"
|
|||
runWebApp :: Wai.Application -> (SockAddr -> IO ()) -> IO ()
|
||||
runWebApp app observer = do
|
||||
sock <- localSocket
|
||||
void $ forkIO $ runSettingsSocket defaultSettings sock app
|
||||
void $ forkIO $ runSettingsSocket webAppSettings sock app
|
||||
observer =<< getSocketName sock
|
||||
|
||||
webAppSettings = defaultSettings
|
||||
-- disable buggy sloworis attack prevention code
|
||||
{ settingsTimeout = 30 * 60
|
||||
}
|
||||
|
||||
{- Binds to a local socket, selecting any free port.
|
||||
-
|
||||
- Prefers to bind to the ipv4 address rather than the ipv6 address
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue