<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/supporting-native-rust-in-workers-with-the-new-emscripten-target-for-wasm-bindgen-fqeuggppz" -->

---
title: Supporting native Rust in Workers with the new...
description: Cloudflare announces experimental preview support for the wasm32-unknown-emscripten Rust compiler target in wasm-bindgen, enabling native Rust code and...
canonical: https://daily.dev/posts/supporting-native-rust-in-workers-with-the-new-emscripten-target-for-wasm-bindgen-fqeuggppz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Supporting native Rust in Workers with the new Emscripten target for wasm-bindgen | daily.dev
og:description: Cloudflare announces experimental preview support for the wasm32-unknown-emscripten Rust compiler target in wasm-bindgen, enabling native Rust code and...
og:url: https://daily.dev/posts/supporting-native-rust-in-workers-with-the-new-emscripten-target-for-wasm-bindgen-fqeuggppz
og:image: https://api.daily.dev/og/posts/FQeUGgppz.png
og:image:alt: Supporting native Rust in Workers with the new Emscripten target for wasm-bindgen
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Supporting native Rust in Workers with the new Emscripten target for wasm-bindgen

**[Cloudflare](https://daily.dev/sources/cloudflare)** · 14 min read · 46 upvotes · 5 comments

## Summary

Cloudflare announces experimental preview support for the wasm32-unknown-emscripten Rust compiler target in wasm-bindgen, enabling native Rust code and Tokio-based async applications to run on Cloudflare Workers. The work, initiated by Google's Portable Toolchains team and extended by Cloudflare, allows wasm-bindgen and Emscripten to interoperate, unlocking support for previously incompatible low-level systems libraries (libc, socket2, Mio) and Tokio's async runtime via two approaches: WebAssembly JavaScript Promise Integration (JSPI) and a new LocalEventLoop runtime design for Tokio. Cloudflare also contributed over 40 pull requests to Emscripten adding a -sNODERAWSOCKETS mode bridging epoll, TCP, UDP, and Unix sockets into Node.js's node:net API. As a demonstration, a Rust-native Pumpkin Minecraft server was ported to run fully persistently and multiplayer-capable inside a single Durable Object, using SQLite-backed file storage and real TCP ingress. Example patchsets and workflows are available now for experimental use.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.cloudflare.com/rust-workers-emscripten-target>

## Questions this post answers

### How do I run Tokio-based async Rust code on Cloudflare Workers?

Cloudflare added experimental support for the wasm32-unknown-emscripten target in wasm-bindgen, letting Tokio applications run on Workers. Since Workers are single-threaded and can't block the JS event loop, Cloudflare supports two integration models: WebAssembly JavaScript Promise Integration (JSPI), which maps to Tokio's parking semantics, and a new LocalEventLoop runtime where Tokio's wait is replaced by a host-driven wake and drive() call.

_Developers integrating async Rust runtimes into JS hosts can track Tokio and Workers updates on daily.dev._

### Can Emscripten support TCP and UDP sockets with epoll for Rust applications in Node.js or Workers?

Yes, Cloudflare contributed over 40 pull requests to Emscripten adding the -sNODERAWSOCKETS compilation option, which bridges Emscripten's virtualization layer to the node:net API, enabling epoll, TCP, UDP, and Unix sockets for Emscripten applications running in Node.js and on Cloudflare Workers, since Workers implements the same node:net API.

_Teams evaluating WebAssembly socket support for Rust services can follow this kind of ecosystem update on daily.dev._

### Is it possible to run a persistent Minecraft server on Cloudflare Durable Objects?

Yes, a Rust-native Pumpkin Minecraft server built on Tokio was ported to run inside a single Durable Object using the new Emscripten target, with world files stored as rows in the object's SQLite storage via a worker-fs-mount library, and player connections handled through Workers TCP ingress and handleAsNodeConnection() dispatching sockets to a net.Server.

_Engineers experimenting with stateful multiplayer workloads on serverless platforms can find deep dives like this on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@debajyatidey** · 3 upvotes

> Whoa finally native rust websites on the edge!

**@ristotoldsep** · 2 upvotes

> A Minecraft server inside a Durable Object is delightfully unhinged. Nice work.

**@hexapaws** · 1 upvotes

> THE RUST CRAB :D

**@trevorsuna** · 1 upvotes

> Getting Tokio and low-level socket libraries onto Workers opens a much wider Rust ecosystem than lightweight WASM examples suggest. Since this is experimental, I’d test event-loop behavior, cancellation, and resource cleanup under Durable Object restarts before depending on native-library compatibility in production.

## Similar posts on daily.dev

- [Introducing OpenWorkers – Self-hosted Cloudflare Workers in Rust](https://daily.dev/posts/introducing-openworkers-self-hosted-cloudflare-workers-in-rust-ag9dqgae1) · Hacker News · 34 upvotes · 3 comments
- [The 7 Walls JavaScript Hits — and How WebAssembly Gets Past Them](https://daily.dev/posts/the-7-walls-javascript-hits-and-how-webassembly-gets-past-them-isxmm7isd) · DEV · 2 upvotes · 0 comments
- [Making Rust Workers reliable: panic and abort recovery in wasm‑bindgen](https://daily.dev/posts/making-rust-workers-reliable-panic-and-abort-recovery-in-wasm-bindgen-gqehvalnl) · Cloudflare · 27 upvotes · 0 comments

---

Tags: [#rust](https://daily.dev/tags/rust), [#webassembly](https://daily.dev/tags/webassembly), [#cloudflare](https://daily.dev/tags/cloudflare)

[View this post on daily.dev](https://daily.dev/posts/supporting-native-rust-in-workers-with-the-new-emscripten-target-for-wasm-bindgen-fqeuggppz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Supporting native Rust in Workers with the new Emscripten target for wasm-bindgen","url":"https://daily.dev/posts/supporting-native-rust-in-workers-with-the-new-emscripten-target-for-wasm-bindgen-fqeuggppz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/supporting-native-rust-in-workers-with-the-new-emscripten-target-for-wasm-bindgen-fqeuggppz"},"datePublished":"2026-09-28T13:02:06.790Z","dateModified":"2026-09-28T13:03:06.065Z","description":"Cloudflare announces experimental preview support for the wasm32-unknown-emscripten Rust compiler target in wasm-bindgen, enabling native Rust code and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/914956a181e48f4b103e34b94f4cb357?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/914956a181e48f4b103e34b94f4cb357?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Cloudflare","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Cloudflare","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/38522e1d11354cd6b7af66f9d4316735","url":"https://daily.dev/sources/cloudflare"},"commentCount":5,"discussionUrl":"https://daily.dev/posts/supporting-native-rust-in-workers-with-the-new-emscripten-target-for-wasm-bindgen-fqeuggppz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":46},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":5}],"keywords":"rust,webassembly,cloudflare","timeRequired":"PT14M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Cloudflare","item":"https://daily.dev/sources/cloudflare"},{"@type":"ListItem","position":3,"name":"Supporting native Rust in Workers with the new Emscripten target for wasm-bindgen"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/supporting-native-rust-in-workers-with-the-new-emscripten-target-for-wasm-bindgen-fqeuggppz","comment":[{"@type":"Comment","text":"Whoa finally native rust websites on the edge!","datePublished":"2026-09-28T17:49:07.835Z","url":"https://daily.dev/posts/FQeUGgppz#c-LlN7gSB8I","author":{"@type":"Person","name":"Debajyati Dey","url":"https://daily.dev/debajyatidey","image":"https://avatars.githubusercontent.com/u/127122455?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"A Minecraft server inside a Durable Object is delightfully unhinged. Nice work.","datePublished":"2026-09-29T10:36:07.890Z","url":"https://daily.dev/posts/FQeUGgppz#c-C9wqwvqEB","author":{"@type":"Person","name":"Risto Tõldsep","url":"https://daily.dev/ristotoldsep","image":"https://lh3.googleusercontent.com/a/ACg8ocLDWc6mZn0JwNmXXw6WY0L_HJ6pegzRttooC5VgtXESHSj3MNYx=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"THE RUST CRAB :D","datePublished":"2026-09-29T03:07:40.866Z","url":"https://daily.dev/posts/FQeUGgppz#c-RhIT16tej","author":{"@type":"Person","name":"HexaPaws","url":"https://daily.dev/hexapaws","image":"https://media.daily.dev/image/upload/s--tvr4YO6b--/f_auto/v1784860169/avatars/avatar_H0URpju3ND0pkrjj1i1mE?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"Getting Tokio and low-level socket libraries onto Workers opens a much wider Rust ecosystem than lightweight WASM examples suggest. Since this is experimental, I’d test event-loop behavior, cancellation, and resource cleanup under Durable Object restarts before depending on native-library compatibility in production.","datePublished":"2026-10-01T06:22:50.362Z","url":"https://daily.dev/posts/FQeUGgppz#c-B3Dzsph6l","author":{"@type":"Person","name":"Trevor Suna","url":"https://daily.dev/trevorsuna","image":"https://media.daily.dev/image/upload/s--dZ7gXxpp--/f_auto/v1784081551/avatars/avatar_EMoP47rpuw8DNjhp6R1b6?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/supporting-native-rust-in-workers-with-the-new-emscripten-target-for-wasm-bindgen-fqeuggppz#faq","mainEntity":[{"@type":"Question","name":"How do I run Tokio-based async Rust code on Cloudflare Workers?","acceptedAnswer":{"@type":"Answer","text":"Cloudflare added experimental support for the wasm32-unknown-emscripten target in wasm-bindgen, letting Tokio applications run on Workers. Since Workers are single-threaded and can't block the JS event loop, Cloudflare supports two integration models: WebAssembly JavaScript Promise Integration (JSPI), which maps to Tokio's parking semantics, and a new LocalEventLoop runtime where Tokio's wait is replaced by a host-driven wake and drive() call. Developers integrating async Rust runtimes into JS hosts can track Tokio and Workers updates on daily.dev."}},{"@type":"Question","name":"Can Emscripten support TCP and UDP sockets with epoll for Rust applications in Node.js or Workers?","acceptedAnswer":{"@type":"Answer","text":"Yes, Cloudflare contributed over 40 pull requests to Emscripten adding the -sNODERAWSOCKETS compilation option, which bridges Emscripten's virtualization layer to the node:net API, enabling epoll, TCP, UDP, and Unix sockets for Emscripten applications running in Node.js and on Cloudflare Workers, since Workers implements the same node:net API. Teams evaluating WebAssembly socket support for Rust services can follow this kind of ecosystem update on daily.dev."}},{"@type":"Question","name":"Is it possible to run a persistent Minecraft server on Cloudflare Durable Objects?","acceptedAnswer":{"@type":"Answer","text":"Yes, a Rust-native Pumpkin Minecraft server built on Tokio was ported to run inside a single Durable Object using the new Emscripten target, with world files stored as rows in the object's SQLite storage via a worker-fs-mount library, and player connections handled through Workers TCP ingress and handleAsNodeConnection() dispatching sockets to a net.Server. Engineers experimenting with stateful multiplayer workloads on serverless platforms can find deep dives like this on daily.dev."}}]}
```

