I am using apache httpcore library to listen for http requests as below.
IOReactorConfig config = IOReactorConfig.custom() // Create instance of a custom Builder
.setTcpNoDelay(true) //
// Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. InputStream associated
// with this Socket will block for only this amount of time. If the timeout expires, a
// java.net.SocketTimeoutException
// is raised, though the Socket is still valid. The option must be enabled prior to entering the
// blocking operation to have effect. The timeout must be > 0. A timeout of zero is interpreted
// as an infinite timeout.
.setSoTimeout(PropertiesStorage.getCcsSocketTimeoutMilis()) //
.setSoReuseAddress(true) //
.setConnectTimeout(PropertiesStorage.getCcsConnectionTimeoutMilis()) //
// Determines the number of I/O dispatch threads to be used by the I/O reactor.
.setIoThreadCount(PropertiesStorage.getCcsDispatchThreadCount()) //
.build();
// Create instance of a server - reactor
private static ListeningIOReactor ioReactor = new DefaultListeningIOReactor(config);
// Listening on specific port
ioReactor.listen(new InetSocketAddress(SERVER_IP, SERVER_PORT));
I want to configure mod_reqtimeout, mod_qos and mod_security, to prevent from "slow denial of service". But I am not sure how do I configure these params. Can you please help ?