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

Support binary transfers #7

Open
3 tasks
dcposch opened this issue Apr 20, 2015 · 1 comment
Open
3 tasks

Support binary transfers #7

dcposch opened this issue Apr 20, 2015 · 1 comment

Comments

@dcposch
Copy link

dcposch commented Apr 20, 2015

This module is sweet! I cant believe it does all of that in so few lines of code

@feross and I just tried streaming a one-hour-long mp3 using webcat.

The first issue we ran into is that webcat doesn't support binary data. Maybe it's interpreting the input as ascii or UTF8? Either way, I had to pipe thru base64 before sending it thru webcat.

With that workaround, it works for a few minutes before it dies. I think what's going on is that there isn't any backpressure, so the receiving webcat process buffers a lot of data. Once the whole (~150MB) file is sent, the sending webcat process closes the connection & exits. The receiving process sees the connection died and exits as well, even though it still has lots of data that needs to be flushed to stdout.

With the following fixes, I think it would work

  • Flush stdout before exiting (most important)
  • Handle binary input
  • Implement back pressure
@feross
Copy link

feross commented Apr 20, 2015

What @dcposch said 👍

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

No branches or pull requests

2 participants