public synchronized Service webSocketIdleTimeoutMillis(long timeoutMillis) {
        if (initialized) {
            throwBeforeRouteMappingException();
        }
        if (isRunningFromServlet()) {
            throw new IllegalStateException("WebSockets are only supported in the embedded server");
        }
        webSocketIdleTimeoutMillis = Optional.of(timeoutMillis);
        return this;
    }
Sets the max idle timeout in milliseconds for WebSocket connections.

@param timeoutMillis The max idle timeout in milliseconds.
@return the object with max idle timeout set for WebSocket connections
src/main/java/spark/Service.java