apps: make idle timeout configurable
diff --git a/tools/apps/src/bin/quiche-client.rs b/tools/apps/src/bin/quiche-client.rs
index 7a303c3..ec8fc1f 100644
--- a/tools/apps/src/bin/quiche-client.rs
+++ b/tools/apps/src/bin/quiche-client.rs
@@ -48,6 +48,7 @@
   --max-stream-data BYTES  Per-stream flow control limit [default: 1000000].
   --max-streams-bidi STREAMS  Number of allowed concurrent streams [default: 100].
   --max-streams-uni STREAMS   Number of allowed concurrent streams [default: 100].
+  --idle-timeout TIMEOUT   Idle timeout in milliseconds [default: 30000].
   --wire-version VERSION   The version number to send to the server [default: babababa].
   --http-version VERSION   HTTP version to use [default: all].
   --dgram-proto PROTO      DATAGRAM application protocol to use [default: none].
@@ -117,7 +118,7 @@
 
     config.set_application_protos(&conn_args.alpns).unwrap();
 
-    config.set_max_idle_timeout(30000);
+    config.set_max_idle_timeout(conn_args.idle_timeout);
     config.set_max_udp_payload_size(MAX_DATAGRAM_SIZE as u64);
     config.set_initial_max_data(conn_args.max_data);
     config.set_initial_max_stream_data_bidi_local(conn_args.max_stream_data);
diff --git a/tools/apps/src/bin/quiche-server.rs b/tools/apps/src/bin/quiche-server.rs
index 350a3c3..5091389 100644
--- a/tools/apps/src/bin/quiche-server.rs
+++ b/tools/apps/src/bin/quiche-server.rs
@@ -54,6 +54,7 @@
   --max-stream-data BYTES     Per-stream flow control limit [default: 1000000].
   --max-streams-bidi STREAMS  Number of allowed concurrent streams [default: 100].
   --max-streams-uni STREAMS   Number of allowed concurrent streams [default: 100].
+  --idle-timeout TIMEOUT   Idle timeout in milliseconds [default: 30000].
   --dump-packets PATH         Dump the incoming packets as files in the given directory.
   --early-data                Enables receiving early data.
   --no-retry                  Disable stateless retry.
@@ -106,7 +107,7 @@
 
     config.set_application_protos(&conn_args.alpns).unwrap();
 
-    config.set_max_idle_timeout(30000);
+    config.set_max_idle_timeout(conn_args.idle_timeout);
     config.set_max_udp_payload_size(MAX_DATAGRAM_SIZE as u64);
     config.set_initial_max_data(conn_args.max_data);
     config.set_initial_max_stream_data_bidi_local(conn_args.max_stream_data);
diff --git a/tools/apps/src/lib.rs b/tools/apps/src/lib.rs
index d951006..6de939b 100644
--- a/tools/apps/src/lib.rs
+++ b/tools/apps/src/lib.rs
@@ -81,6 +81,7 @@
     pub max_stream_data: u64,
     pub max_streams_bidi: u64,
     pub max_streams_uni: u64,
+    pub idle_timeout: u64,
     pub dump_packet_path: Option<String>,
     pub no_grease: bool,
     pub cc_algorithm: String,
@@ -158,6 +159,9 @@
         let max_streams_uni = args.get_str("--max-streams-uni");
         let max_streams_uni = u64::from_str_radix(max_streams_uni, 10).unwrap();
 
+        let idle_timeout = args.get_str("--idle-timeout");
+        let idle_timeout = u64::from_str_radix(idle_timeout, 10).unwrap();
+
         let dump_packet_path = if args.get_str("--dump-packets") != "" {
             Some(args.get_str("--dump-packets").to_string())
         } else {
@@ -176,6 +180,7 @@
             max_stream_data,
             max_streams_bidi,
             max_streams_uni,
+            idle_timeout,
             dump_packet_path,
             no_grease,
             cc_algorithm: cc_algorithm.to_string(),