Warp Port Reuse

Hello, I wonder how to pass “Reuse Port” option into the Warp settings so that on server restart, those “Address in use” error never appears. I use “CTRL+C” to close the current running Warp server, and use stack run to run it.

import Network.Wai.Handler.Warp (setPort, defaultSettings)
warpOpts = setPort 8080 defaultSettings


Network.Socket.bind: resource busy (Address already in use)

Might be possible to reuse the port, but i would have tried to make ctrl-c do a clean shutdown.

1 Like