Skip to content

Conversation

@rvolosatovs
Copy link
Member

@rvolosatovs rvolosatovs commented Dec 23, 2025

This PR introduces a virtual wasi:sockets loopback, which is isolated from the OS and is implemented in-process.

With this changeset:

  • workload components cannot bind on any IP using TCP
  • workload components cannot connect to OS loopback using TCP
  • workload services can bind on either loopback (virtualized) or unspecified IP using TCP. Bind on unspecified IP will use the TCP port on the OS. Services can receive TCP packets destined for OS localhost (or whatever corresponds to unspecified IP on the OS) by binding and listening on unspecified IP.
  • workload components/services can bind on either loopback (virtualized) or unspecified IP using UDP. Bind on unspecified IP will use the UDP port on the OS. Both components and services can receive UDP packets destined for OS localhost (or whatever corresponds to unspecified IP on the OS) by binding to unspecified IP.
  • workload components cannot send packets to OS localhost using UDP

wasmtime-wasi is copy-pasted into this repo and modified. The actual loopback implementation is in this commit: f7bc41b

Before release to crates.io, the patch section has to be removed from Cargo.toml (it should stay on main, however, such that we could test wash-wasi)

This PR must not be squashed

@rvolosatovs rvolosatovs force-pushed the feat/tcp-localhost branch 7 times, most recently from 9e61259 to 7019e7f Compare December 26, 2025 16:15
@rvolosatovs rvolosatovs changed the title virtual TCP localhost virtual TCP loopback Dec 26, 2025
@rvolosatovs rvolosatovs force-pushed the feat/tcp-localhost branch 2 times, most recently from 841e22f to c6dffbd Compare December 26, 2025 16:31
@rvolosatovs rvolosatovs marked this pull request as ready for review December 26, 2025 16:31
@rvolosatovs rvolosatovs requested a review from a team as a code owner December 26, 2025 16:31
@rvolosatovs rvolosatovs changed the title virtual TCP loopback virtual TCP/UDP loopback Dec 29, 2025
@rvolosatovs rvolosatovs force-pushed the feat/tcp-localhost branch 2 times, most recently from eb696c5 to 2ae500b Compare January 5, 2026 12:49
@lxfontes lxfontes moved this to Discuss in wash v2 release Jan 7, 2026
Signed-off-by: Roman Volosatovs <[email protected]>
Signed-off-by: Roman Volosatovs <[email protected]>
Signed-off-by: Roman Volosatovs <[email protected]>
@lxfontes lxfontes added this pull request to the merge queue Jan 13, 2026
Merged via the queue into wasmCloud:main with commit bedf267 Jan 13, 2026
9 checks passed
@github-project-automation github-project-automation bot moved this from Discuss to Done in wash v2 release Jan 13, 2026
@rvolosatovs rvolosatovs deleted the feat/tcp-localhost branch January 13, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants