From: Teemu Hukkanen <tjhukkan@iki.fi>
Date: Mon, 18 Mar 2024 14:28:01 +0200
Subject: Improve manpages

Add examples, adapted from the README file.
Add SEE ALSO section.
Fix dash quoting in htc.1.

Forwarded: yes
---
 htc.1 | 25 +++++++++++++++++++++++--
 hts.1 | 26 ++++++++++++++++++++++++--
 2 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/htc.1 b/htc.1
index 73f10b1..c577262 100644
--- a/htc.1
+++ b/htc.1
@@ -21,7 +21,7 @@ A summary of options are included below.
 .B \-h, \-\-help
 Show summary of options.
 .TP
-.B \-c, \-\-content-length BYTES
+.B \-c, \-\-content\-length BYTES
 use HTTP PUT requests of BYTES size (k, M, and G postfixes recognized)
 .TP
 .B \-d, \-\-device DEVICE
@@ -58,7 +58,7 @@ use stdin/stdout for communication (implies \-\-no\-daemon)
 .B \-T, \-\-timeout TIME
 timeout, in milliseconds, before sending padding to a buffering proxy
 .TP
-.B \-U, \-\-user-agent STRING
+.B \-U, \-\-user\-agent STRING
 specify User-Agent value in HTTP requests
 .TP
 .B \-R, \-\-base\-uri STRING
@@ -71,6 +71,27 @@ output version information and exit
 .B \-w, \-\-no-daemon
 don't fork into the background
 
+.SH EXAMPLES
+.TP
+Start httptunnel server
+.B hts \-F localhost:22 8888
+Aat host REMOTE, set up httptunnel server to listen on port 8888 and
+forward to localhost:22
+.TP
+Start httptunnel client
+.B htc \-F 2222 \-P PROXY_ADDRESS:8000 REMOTE_IP:8888
+At host LOCAL, set up httptunnel client to forward localhost:2222 to
+REMOTE_IP:8888 via a local proxy at PROXY_ADDRESS:8000
+.TP
+Or, if using a buffering HTTP proxy
+.B htc \-F 2222 \-P PROXY_ADDRESS:8000 -B 48K REMOTE_IP:8888
+.TP
+Now you can connect through the tunnel on host LOCAL
+.B ssh ssh://localhost:2222
+
 .SH AUTHOR
 This manual page was contributed by Teemu Hukkanen <tjhukkan@iki.fi>,
 and was originally written for the Debian GNU/Linux system.
+
+.SH SEE ALSO
+.MR hts 1
diff --git a/hts.1 b/hts.1
index 9399746..6c672c7 100644
--- a/hts.1
+++ b/hts.1
@@ -22,7 +22,7 @@ A summary of options are included below.
 .B \-h, \-\-help
 Show summary of options.
 .TP
-.B \-c, \-\-content-length BYTES
+.B \-c, \-\-content\-length BYTES
 use HTTP PUT requests of BYTES size (k, M, and G postfixes recognized)
 .TP
 .B \-d, \-\-device DEVICE
@@ -46,7 +46,7 @@ always write Content-Length bytes in requests
 .B \-V, \-\-version
 output version information and exit
 .TP
-.B \-w, \-\-no-daemon
+.B \-w, \-\-no\-daemon
 don't fork into the background
 .TP
 .B \-p, \-\-pid\-file LOCATION
@@ -57,6 +57,28 @@ chroot to LOCATION before serving clients
 .TP
 .B \-u, \-\-user USER
 change user and group identities before serving clients
+
+.SH EXAMPLES
+.TP
+Start httptunnel server
+.B hts \-F localhost:22 8888
+Aat host REMOTE, set up httptunnel server to listen on port 8888 and
+forward to localhost:22
+.TP
+Start httptunnel client
+.B htc \-F 2222 \-P PROXY_ADDRESS:8000 REMOTE_IP:8888
+At host LOCAL, set up httptunnel client to forward localhost:2222 to
+REMOTE_IP:8888 via a local proxy at PROXY_ADDRESS:8000
+.TP
+Or, if using a buffering HTTP proxy
+.B htc \-F 2222 \-P PROXY_ADDRESS:8000 -B 48K REMOTE_IP:8888
+.TP
+Now you can connect through the tunnel on host LOCAL
+.B ssh ssh://localhost:2222
+
 .SH AUTHOR
 This manual page was contributed by Teemu Hukkanen <tjhukkan@iki.fi>,
 and was originally written for the Debian GNU/Linux system.
+
+.SH SEE ALSO
+.MR htc 1
