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

By default stream is outputting string is there a way to get a Buffer? #1439

Open
metawrap-dev opened this issue Jan 23, 2025 · 1 comment
Open

Comments

@metawrap-dev
Copy link

I am implementing a server, and logging data arriving from a stream after a call to

// Create a stream for Git Smart Protocol communication
const stream: ssh2.ServerChannel = acceptExec()

By that I mean performing a typeof on the object from stream.on('data', data => {console.log(typeof data)}) returns string

Am I doing something wrong?

@mscdex
Copy link
Owner

mscdex commented Jan 23, 2025

Are you using ssh2 directly? If so, can you show a complete minimal example in JS that reproduces the problem? Streams should always emit Buffers unless you call something like stream.setEncoding().

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