Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(websocket,websocket-websys): Add support for /tls/ws #5523

Merged
merged 22 commits into from
Aug 8, 2024

Conversation

oblique
Copy link
Contributor

@oblique oblique commented Aug 2, 2024

Description

To keep backward compatibility the following rules were implemented:

  • On dialing, /tls/ws and /wss are equivalent.
  • On listening:
    • If user listens with /tls/ws then /tls/ws will be advertised.
    • If user listens with /wss then /wss will be advertised.

Closes #2449
Closes #5509

Notes & open questions

Doing the change directly in multiaddr crate as multiformats/rust-multiaddr#100 suggests it would break compatibility and two different versions of libp2p that support websocket wouldn't be able to communicate. I decided to give the decision to the user by providing the listening address they want.

This PR contains all changes of #5525 PR, so merge that one first.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@oblique
Copy link
Contributor Author

oblique commented Aug 2, 2024

I can not add reviewers, so I'm tagging you: @jxs @thomaseizinger

@oblique oblique changed the title feat(websocket,websocket-websys): Add support for /tls/ws feat(websocket,websocket-websys): Add support for /tls/ws and keep /wss backward compatible Aug 2, 2024
Copy link
Contributor

mergify bot commented Aug 3, 2024

This pull request has merge conflicts. Could you please resolve them @oblique? 🙏

@jxs jxs changed the title feat(websocket,websocket-websys): Add support for /tls/ws and keep /wss backward compatible feat(websocket,websocket-websys): Add support for /tls/ws Aug 7, 2024
Copy link
Contributor

mergify bot commented Aug 7, 2024

This pull request has merge conflicts. Could you please resolve them @oblique? 🙏

Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks Yiannis

@jxs jxs added the send-it label Aug 8, 2024
@mergify mergify bot merged commit 4725f46 into libp2p:master Aug 8, 2024
72 checks passed
@oblique oblique deleted the feat/tls-ws branch August 8, 2024 15:45
TimTinkers pushed a commit to unattended-backpack/rust-libp2p that referenced this pull request Sep 14, 2024
To keep backward compatibility the following rules were implemented:

* On dialing, `/tls/ws` and `/wss` are equivalent.
* On listening:
* If user listens with `/tls/ws` then `/tls/ws` will be advertised.
* If user listens with `/wss` then `/wss` will be advertised.

Closes libp2p#2449
Closes libp2p#5509

Pull-Request: libp2p#5523.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

websocket wasm cannot dial /tls/ws addresses libp2p-websocket: replace /wss with /tls/ws
3 participants