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

Need a module to talk bittorrent peer wire protocol in browser #12

Closed
feross opened this issue Nov 10, 2013 · 4 comments
Closed

Need a module to talk bittorrent peer wire protocol in browser #12

feross opened this issue Nov 10, 2013 · 4 comments
Assignees

Comments

@feross
Copy link
Member

@feross feross commented Nov 10, 2013

  • Should work over any stream interface
  • Use bops
  • Use peer-wire-protocol module as a guide
@ghost ghost assigned feross Nov 10, 2013
@mafintosh

This comment has been minimized.

Copy link

@mafintosh mafintosh commented Nov 11, 2013

Wouldn't peer-wire-protocol work in the browser using browserify?

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Nov 11, 2013

I gave it a shot but ran into problems because you used the node Buffer which doesn't exist in the browser. So, browserify adds it's own shoddy buffer implementation which is slow and has weird bugs. The right way to do it, as I understand it, is to use bops which works in both environments with the same API -- it uses Buffer in node and Uint8Array in the browser.

But you're right -- I should investigate more before doing a fork of peer-wire-protocol... Would you accept a pull request that uses bops and might decrease performance a bit (since with bops you sometimes have to do a copy where with Buffer you don't need to)?

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Dec 4, 2013

This task is finished. See bittorrent-protocol (fork of peer-wire-protocol) which works in the browser. It initially used bops but I switched it to just use normal Buffers with native-buffer-browserify which will be merged in browserify hopefully soon. I'm not sure what (if anything) is different in the fork, but I expect these changes can be merged upstream.

@feross feross closed this Dec 4, 2013
@mafintosh

This comment has been minimized.

Copy link

@mafintosh mafintosh commented Dec 4, 2013

Sorry for not getting back to you. Looks great.
Just skimmed your source and overall it looks very similar. I'd be happy to include these changes in peer-wire-protocol and add you as a maintainer if you want (to avoid having two very similar modules)?

@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.