-
Notifications
You must be signed in to change notification settings - Fork 942
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
Add get_address_proto to handle trailing "tls/ws" in multiaddr #2487
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Some ideas for how this could be improved :)
I guess this is a first step 👍 , but for #2449 to be finished we need a couple more changes, such as producing |
@tomaka or @thomaseizinger some help on finishing this up? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't comment on what @tomaka said unfortunately. I am not familiar enough with the code here.
I am not particularly familiar with this code. @tomaka your input would be more helpful here. In regards to above comment on this still missing some parts, if I am not mistaken the code below would append a rust-libp2p/transports/websocket/src/framed.rs Lines 165 to 166 in 90140a6
Is that of some help @jochasinga? |
Before returning Ws protocol when hitting the last trailing `/ws` in a multiaddr, check to see if the next path segment is `/tls`. If it is, then return Wss instead. This addresses libp2p#2499 the deprecated `/wss` specifier for the new `/tls/ws` in the spec.
This was from the last test which had the typo and happily passed.
…addr into it Previously, the function borrow a mutable multiaddr reference from the caller without returning it. To make the API simpler, now it's moved into the function and the mutated multiaddr is returned as part of the triplet tuples.
Refactor get_address_proto into a tuple-matching statement and use `Iter::last()` to peek into the next protocol segment instead of cloning.
31a93f1
to
9cdaa58
Compare
Before returning
Ws
protocol when hitting the last trailing/ws
in a multiaddr,check to see if the next path segment is
/tls
. If it is, then returnWss
instead.This addresses #2449 the deprecated
/wss
specifier for the new/tls/ws
in the spec.