about summary refs log tree commit diff stats
path: root/adapter/protocol/ssl.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-05-01 16:08:55 +0200
committerbptato <nincsnevem662@gmail.com>2025-05-01 16:08:55 +0200
commit25cb585ed6ecfc7f4b2a6cdb2e2b52258ddb9144 (patch)
treeabc46cb501962443a5a07d271b918266584a0b9b /adapter/protocol/ssl.nim
parent7da7f8e293b27eda94655574df7d2444f6e5fb3b (diff)
downloadchawan-25cb585ed6ecfc7f4b2a6cdb2e2b52258ddb9144.tar.gz
Improve static builds
Now we generate a single "ssl" binary for CGI scripts that need OpenSSL
to reduce the output size.
Diffstat (limited to 'adapter/protocol/ssl.nim')
-rw-r--r--adapter/protocol/ssl.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/adapter/protocol/ssl.nim b/adapter/protocol/ssl.nim
new file mode 100644
index 00000000..253c2cdf
--- /dev/null
+++ b/adapter/protocol/ssl.nim
@@ -0,0 +1,16 @@
+import std/envvars
+
+import gemini
+import http
+import sftp
+
+proc main() =
+  let scheme = getEnv("MAPPED_URI_SCHEME")
+  if scheme == "gemini":
+    gemini.main()
+  elif scheme == "sftp":
+    sftp.main()
+  else:
+    http.main()
+
+main()