Sans-I/O VNC/RFB client engine ported from Rust vnc-rs: negotiation, authentication, framebuffer and input
fn new_session() -> @rfb.Client raise @rfb.RfbError {
@rfb.client(options={ ..@rfb.default_options(), password: Some([115, 101, 99, 114, 101, 116]) })
}moon build --target js --deny-warn
npm run examples
# 或分别运行
node examples/capture.cjs
node examples/input.cjs
node examples/replay.cjsmoon test --target wasm-gc --deny-warn
npm ci --ignore-scripts
node tools/differential.cjs
node tools/trle-corpus.cjs
node tools/upstream-differential.cjs # 需要 rustc,编译原版 Rust DES
node tools/benchmark.cjs
python tools/verify.py # 完整检查;可显式 --defer-native --defer-rust| 对标或测量 | 已取得的本地结果 |
|---|---|
| MoonBit 单元/边界测试 | 26 项,wasm-gc / wasm / js 通过;native 在 Linux CI 构建与测试通过 |
| noVNC 1.7.0 原版模块 | DES 1,000 组、Raw 250 组/41,505 像素、CopyRect 100 组/400 像素,差异为 0 |
| 独立 RFC 6143 TRLE 编码语料 | 442 组有效样本/32,555 像素;另有 6 组畸形输入,全部通过 |
| 640×480 Raw 解码 | 本地 JS debug,预热 5 次、测量 30 次:中位 6.75 ms,P95 8.01 ms,45.49 Mpix/s |
pub struct Client {
// private fields
}pub struct Framebuffer {
// private fields
}fn Framebuffer::copy_rect(self : Framebuffer, dest : Rect, source_x : Int, source_y : Int) -> Unit raise RfbErrorpub(all) struct Screen {
width : Int
height : Int
format : PixelFormat
name : Array[Int]
} derive(Eq, Debug)fn decode_raw(data : Array[Int], format : PixelFormat, width : Int, height : Int) -> Array[Int] raise RfbErrorfn decode_trle(data : Array[Int], format : PixelFormat, width : Int, height : Int) -> Array[Int] raise RfbErrorInstall
Download zipSans-I/O VNC/RFB client engine ported from Rust vnc-rs: negotiation, authentication, framebuffer and input