From b69f3c79037ec7ead6700eb8fa70deac71f08466 Mon Sep 17 00:00:00 2001 From: zephyr Date: Thu, 21 Apr 2022 03:18:00 +0900 Subject: [PATCH] libkaminari v0.6.0; strip binary --- Cargo.lock | 10 +++++----- Cargo.toml | 1 + cmd/Cargo.toml | 4 ++-- cmd/README.md | 28 ++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f447fd..e041836 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -129,9 +129,7 @@ dependencies = [ [[package]] name = "kaminari" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f45bd66f9196bc52337ca284236e897e5411f951662ef44984b55895bd84ccab" +version = "0.6.0" dependencies = [ "lazy_static", "lightws", @@ -145,6 +143,8 @@ dependencies = [ [[package]] name = "kaminari" version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c916164c17dac1db5b54b4a17050474f895ca3676d81ec9fb074292f7ef64d33" dependencies = [ "lazy_static", "lightws", @@ -157,10 +157,10 @@ dependencies = [ [[package]] name = "kaminari-cmd" -version = "0.4.2" +version = "0.4.3" dependencies = [ "anyhow", - "kaminari 0.5.5", + "kaminari 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio", ] diff --git a/Cargo.toml b/Cargo.toml index 4c96cd8..015eed2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,3 +5,4 @@ members = ["kaminari", "cmd"] opt-level = 3 lto = true panic = "abort" +strip = true diff --git a/cmd/Cargo.toml b/cmd/Cargo.toml index d18a368..28fcbeb 100644 --- a/cmd/Cargo.toml +++ b/cmd/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kaminari-cmd" -version = "0.4.2" +version = "0.4.3" edition = "2021" authors = ["zephyr "] repository = "https://github.com/zephyrchien/kaminari/cmd" @@ -9,7 +9,7 @@ readme = "README.md" license = "GPL-3.0" [dependencies] -kaminari = "0.5.5" +kaminari = "0.6.0" tokio = { version = "1", features = ["net", "macros", "rt-multi-thread", "io-util"] } anyhow = "1" diff --git a/cmd/README.md b/cmd/README.md index 20a785b..8a7e2e0 100644 --- a/cmd/README.md +++ b/cmd/README.md @@ -63,6 +63,18 @@ Client or server side options: - `path=`* : set http path. +Client side extra options: + +- `mask=` : set mask mode. Available values: [skipped, standard, fixed] + +#### About Mask Mode + +A websocket client should mask the payload before sending it. + +With `mode=skip`(default mode), we use an empty mask key(0x00..0) to simply skip masking, which can also be detected by our server, and then skip unmasking. Other softwares(Nginx, Haproxy, CDNs..) can still correctly handle our data without knowing this trick. + +As for `mode=fixed` or `mode=standard`, client will mask the payload data as normal. In `fixed` mode, client will use the same mask key for a unique websocket connection. While In `standard` mode, client will update the mask key between sending each frames. + ### TLS Options use `tls` to enable tls. @@ -85,6 +97,22 @@ Requires either `cert+key` or `servername`. - `servername=`* : generate self signed cert/key, use $name as CN. +- `ocsp=`: der-encoded OCSP response. + +#### OCSP Stapling + +See [Wikipedia](https://en.wikipedia.org/wiki/OCSP_stapling). + +Openssl example for [Let's Encrypt](https://letsencrypt.org/): + +```shell +openssl ocsp -issuer \ + -cert \ + -url http://r3.o.lencr.org \ + -header Host=r3.o.lencr.org \ + -respout -noverify -no_nonce +``` + ### Examples tcp ⇋ ws --- ws ⇋ tcp: