Repository navigation
feat: expose TCP keepalive options through WISP - #1
Closed
syrusakbary wants to merge 2 commits into
Closed
syrusakbary wants to merge 2 commits into
syrusakbary wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This full TCP keepalive timing work is no longer required for the Pi integration. Edge.js #155 uses the existing basic
SO_KEEPALIVEoption in its native WASIX binding and skips unsupported timing options. Pi works with the stock libc and original WISP transport. Full configurable probe timing is deferred; Wasmer #7035 and libuv #15 are being kept focused on filesystem timestamps.Browser WASIX clients currently cannot apply TCP keepalive timing options through WISP: the proxy protocol has no socket-option request or acknowledgement. Add an opt-in, versioned private extension (
0xF2, metadata[1]) with SET/GET requests on0xF2and replies on0xF3for enabled, idle seconds, interval seconds, and probe count. Successful replies read back the actual outbound socket; unsupported options and OS errors remain errors.The extension waits for a connecting stream, preserves the enabled state when changing timings, and owns a duplicated descriptor until forwarding ends. Stream registrations retain their identity when a closed stream ID is reused. Both peers must negotiate the extension. Existing TWisp/Wispnet IDs remain unchanged, and the Wasmer package enables the extension without loosening its destination policy.
The mux gains backward-compatible stream lifecycle/control hooks and continues reading after an extension packet, fixing the previous early end of its read stream. Control requests wait without holding the transport write lock so failed connections can close and wake the pending request.
The native backend uses POSIX socket options. The WASIX backend imports the new runtime socket option IDs directly, avoiding the old libc mapping, and uses the existing WASIX
fd_dup2operation because Rust's WASI descriptor-cloning implementation returns unsupported. The deployed proxy host must also include the runtime support; this PR does not publish a package or deploy a proxy.Related runtime work:
Validation:
./wasmer/test-native-keepalive.sh --nocapture: four native tests pass, covering kernel readback, enabled-state preservation, real OS errors, negotiation/version rejection, requests while connecting, failed-connect wakeup, repeated controls, normal DATA after controls, and stream ID reuse.cargo wasix build --release --package epoxy-server --locked: WASIX release build passes.Production deployment still requires a host with the companion runtime changes. No package has been published and no proxy deployment has been changed.