mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #1133] Can this library run in WASM? #610
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#610
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @amaury1093 on GitHub (Jun 10, 2020).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1133
Is your feature request related to a problem? Please describe.
I'm trying to deploy my code to Cloudfare Workers, which run JS & WASM. Specifically, I'm using the
async-std-resolvercrate, but right now compilation fails.Describe the solution you'd like
Add a feature flag which would allow targetting this library to WASM.
Describe alternatives you've considered
n/a
Additional context
Right now, it relies on
resolv-conf, which iiuc can't be compiled to wasm. Maybe returning an empty-file stub in wasm would work?@bluejekyll commented on GitHub (Jun 10, 2020):
What is the context for this runtime? A browser?
The proto crate has been used in WASM, but I don’t know what the expectation of the runtime would be in a WASM environment for the resolver. Would WASI be at least a requirement for network access, to be run in a Node environment?
@amaury1093 commented on GitHub (Jun 10, 2020):
In my case, it's Cloudfare Workers. According to their blog, the runtime context is their edge compute architecture, and it's compatible the W3C Service Worker API.
I believe a Node environment shouldn't be expected (e.g. I don't think resolver should in this case read config files on the filesystem), but for network access the runtime context can be assumed to be compatible with either WASI or Service Worker API (ideally both, e.g. if they share the same API for network access).
@bluejekyll commented on GitHub (Jun 10, 2020):
I haven't investigated this. We have a few options. Right now trust-dns-resolver supports two Runtimes,
Tokioandasync-std.RuntimeorConnectionProviderthat would implement the appropriate socket creation methods.