Comments (15)
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.
The code implementation completely refers to the existing implementation, but it still reports an error
Is this a back-end problem?
from zmodemjs.
Can you provide a test case that fails?
from zmodemjs.
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.
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.
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
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.
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.
@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.
@Lvyc1995 https://github.com/FGasper/zmodemjs#troubleshooting
from zmodemjs.
@Lvyc1995 https://github.com/FGasper/zmodemjs#troubleshooting
thanks
from zmodemjs.
@walirt Hi,I encountered the same problem as you, Have you solved it, I want to see your example,thanks.
from zmodemjs.
建议参考一下这个项目,逻辑是一样的:https://github.com/huyuan1999/django-webssh
from zmodemjs.
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.
I have solved the problem!
copy for example
let zsentry = new Zmodem.Sentry( {
to_terminal(octets) { .. }, //i.e. send to the terminalsender(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.
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)
- uglifyjs: SyntaxError: Unexpected token: name (ZmodemError) HOT 4
- Uncaught TypeError: Cannot read property 'ZRPOS' of null HOT 38
- Xtermjs + ssh2 ,How to use zmodemjs? HOT 5
- 'Zmodem.Browser' is Undefined HOT 1
- Uncaught RangeError: Maximum call stack size exceeded HOT 3
- Unhandled header! HOT 2
- Vue HOT 1
- Cannot read property ‘Sentry’ of undefined
- No progress report on sending HOT 6
- when sz in linux, crc32 failed HOT 11
- How do I exit upload or download on the zmodemjs
- Not receiving `OO` causes session to get stuck HOT 5
- Having trouble in cancel a upload process HOT 4
- After upgrade from 0.1.7 to 0.1.9 rz do not work any more HOT 50
- Ready enough for general usage? HOT 2
- xterm.js v4 and zmodem.js HOT 2
- how can i use this with jquery HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zmodemjs.