Coder Social home page Coder Social logo

Unhandled header! about zmodemjs HOT 15 CLOSED

fgasper avatar fgasper commented on April 19, 2024 3
Unhandled header!

from zmodemjs.

Comments (15)

FGasper avatar FGasper commented on April 19, 2024

Best advice I can offer is to refer to existing implementations (e.g., ttyd). There’s also an example sz CLI implementation in the repo.

from zmodemjs.

walirt avatar walirt commented on April 19, 2024

The code implementation completely refers to the existing implementation, but it still reports an error
Is this a back-end problem?

from zmodemjs.

FGasper avatar FGasper commented on April 19, 2024

Can you provide a test case that fails?

from zmodemjs.

walirt avatar walirt commented on April 19, 2024

yes
the test case in this repository can reproduce this situation
you can enter rz and sz commands in the terminal
then you will find the error in the console
thanks

from zmodemjs.

FGasper avatar FGasper commented on April 19, 2024

Can you please rework that to a test case for this repository, some JS code that demonstrates how the library as it stands is behaving contrary to its documentation?

from zmodemjs.

walirt avatar walirt commented on April 19, 2024

I found out why I didn't set the sender callback
I'm sorry
But then there's a new error. SZ sometimes returns an error
image
Does this mean that I need to send "OO" after saving the file to disk
Like this

Zmodem.Browser.save_to_disk(
xfer._spool,
xfer.get_details().name
)
that.ws.send(new Uint8Array([79, 79]))

from zmodemjs.

FGasper avatar FGasper commented on April 19, 2024

I’m closing this, as there hasn’t yet materialized a test case that shows a reproducible bug.

I do recognize that it’s hard to get use of this library correct. I’d also accept a PR to add examples of correct usage.

from zmodemjs.

Lvyc1995 avatar Lvyc1995 commented on April 19, 2024

@walirt Hello, I encountered the same problem as you, how did you solve it? Where do you mean to set the sender callback? How to solve the subsequent OO problem? Can you provide an simple example? thanks

from zmodemjs.

FGasper avatar FGasper commented on April 19, 2024

@Lvyc1995 https://github.com/FGasper/zmodemjs#troubleshooting

from zmodemjs.

Lvyc1995 avatar Lvyc1995 commented on April 19, 2024

@Lvyc1995 https://github.com/FGasper/zmodemjs#troubleshooting

thanks

from zmodemjs.

xiaowang04821 avatar xiaowang04821 commented on April 19, 2024

@walirt Hi,I encountered the same problem as you, Have you solved it, I want to see your example,thanks.

from zmodemjs.

Lvyc1995 avatar Lvyc1995 commented on April 19, 2024

建议参考一下这个项目,逻辑是一样的:https://github.com/huyuan1999/django-webssh

from zmodemjs.

hessonsu avatar hessonsu commented on April 19, 2024

I have solved the problem!
copy for example

let zsentry = new Zmodem.Sentry( {
to_terminal(octets) { .. }, //i.e. send to the terminal

sender(octets) { .. },  //i.e. send to the ZMODEM peer

on_detect(detection) { .. },  //for when Sentry detects a new ZMODEM

on_retract() { .. },  //for when Sentry retracts a Detection

} );

modify code
sender(octets) { websocket.send(new Uint8Array(octets) }

from zmodemjs.

walirt avatar walirt commented on April 19, 2024

I have solved the problem!

copy for example
let zsentry = new Zmodem.Sentry( {
to_terminal(octets) { .. }, //i.e. send to the terminal

sender(octets) { .. },  //i.e. send to the ZMODEM peer

on_detect(detection) { .. },  //for when Sentry detects a new ZMODEM

on_retract() { .. },  //for when Sentry retracts a Detection

} );

modify code
sender(octets) { websocket.send(new Uint8Array(octets) }

My code is the same as yours, but it still reports errors
Uncaught PROTOCOL: Only thing after ZFIN should be “OO” (79,79)

from zmodemjs.

Lvyc1995 avatar Lvyc1995 commented on April 19, 2024

Your back-end code needs to process the'OO' code returned by the server. This process requires the cooperation of the front and back ends.You can refer to this project: https://github.com/huyuan 1999/django-webssh, the relevant logic in ssh.py

from zmodemjs.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.