Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support wasm #38

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

feat: support wasm #38

wants to merge 4 commits into from

Conversation

olehmisar
Copy link

I needed to parse dkim signature in js and this is the only good library I found. These are the changed I applied in order to compile this library to WASM. Consider using these changes as a reference if you want to add WASM support to this library natively.

Overview:

  • hide resolver behind a feature flag because mio is not supported in WASM
  • use WASM-compatible features of zip and mail-builder crates
  • made get_canonicalized_header non-async because it does not need to be.

For those who want to use this library in a WASM project, you can install my fork like this:

[dependencies]
wasm-bindgen = "0.2.84"
ring = { version = "0.17.7", features = ["wasm32_unknown_unknown_js"] }
getrandom = {version ="0.2.15", features = ["js"] }
mail-auth = { git="https://github.com/olehmisar/mail-auth.git", rev="fb1d434", features=["ring"], default-features = false  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant