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

add a number to websockets #20

Closed
wants to merge 1 commit into from

Conversation

daviddias
Copy link
Member

No description provided.

@daviddias
Copy link
Member Author

@whyrusleeping I'm confused. go-ipfs uses ws for websockets but it seems that there is no reference for the ws on this package.

I want to make sure that we are using the same protocol name and number https://github.com/jbenet/js-multiaddr/blob/master/src/protocols.js#L44

477 0 websockets
Copy link
Member

Choose a reason for hiding this comment

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

Can we please use V instead of 0? As discussed before websocket addresses can have variable length, and this would make it much easier later on

Copy link
Member Author

Choose a reason for hiding this comment

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

From what I heard from @whyrusleeping, @jbenet proposed that ws means 'no path' and wsn represents a websockets addr with paths.

Copy link
Member

Choose a reason for hiding this comment

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

Is this written down somewhere? Cause we should add these things to the multiaddr spec first before changing implementations all over the place

Copy link
Member Author

Choose a reason for hiding this comment

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

💯 % agree.

Copy link
Member

Choose a reason for hiding this comment

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

From what I heard from @whyrusleeping, @jbenet proposed that ws means 'no path' and wsn represents a websockets addr with paths.

wait, i thought it was:

  • ws is path without a number telling you long the path should be (/ws/foo/bar/baz) -- cannot encapsulate
  • wsn is a path with a number telling the number of path components (/ws/3/foo/bar/baz) -- can encapsulate

we could also do:

  • ws16 a base16 (hex) encoded path or something /ws/2f666f6f2f6261722f62617a0a or ws32 or ws58 -- can encapsulate, variable length but not variable components

Copy link
Member

Choose a reason for hiding this comment

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

And yes, +1 on getting this written down properly in multiaddr spec

Copy link
Member

Choose a reason for hiding this comment

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

having ws mean "path, but not encapsulated" makes it next to useless for us. Ipfs can't use a multiaddr that it cant encapsulate. The only distinction that makes sense is for ws to mean "No path" and wsn to be the number thing as we said.

@ghost
Copy link

ghost commented Feb 12, 2017

Closing this as we've moved to using zero-length /ws (covered by #46), and will take care of HTTP paths sometime soon.

@ghost ghost closed this Feb 12, 2017
@daviddias daviddias deleted the patch-1 branch February 12, 2017 16:50
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants