feat: fallback to ICANN endpoint for native clients when Pubky TLS is unreachable#324
Open
francismars wants to merge 2 commits intopubky:mainfrom
Open
feat: fallback to ICANN endpoint for native clients when Pubky TLS is unreachable#324francismars wants to merge 2 commits intopubky:mainfrom
francismars wants to merge 2 commits intopubky:mainfrom
Conversation
…able When a homeserver is behind a Cloudflare Tunnel (or NAT/firewall), the native Pubky TLS endpoint (port 6287) is unreachable from external clients. This adds a TCP probe + fallback: if the Pubky TLS endpoint times out within 3s and an ICANN endpoint is published in the PKARR record, the request is transparently rerouted to the ICANN HTTPS endpoint with a pubky-host header. Co-authored-by: Cursor <cursoragent@cursor.com>
Route malformed _pubky hosts through ICANN handling for native parity and add focused regression tests for prefixed transport host rejection in prepare_request and cross_request. Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
@SeverinAlexB please review 🤲 |
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 PR adds native SDK fallback to ICANN HTTPS when Pubky TLS is unreachable.
Why
Native clients can fail to reach Pubky-host endpoints when a homeserver is behind Cloudflare Tunnel, NAT, or other proxy/network setups. In these cases, PKARR may advertise a Pubky TLS endpoint that is not reachable from the client network, while the ICANN HTTPS endpoint is reachable.
What changed
In
pubky-sdk/src/client/http_targets/native.rs:cross_request:pubky-hostheader._pubky.*classificationpubky<z32>transport host inprepare_request_pubky.pubky<z32>viacross_requestBehavior summary
Test plan
cargo test -p pubky --lib http_targets::native -- --nocapture✅cargo clippy -p pubky -- -D warnings✅Scope / non-goals