update apps to new Antunnel frame format

This commit is contained in:
Dany LE 2021-10-27 13:49:08 +02:00
parent e863fef93d
commit 959d5966af
27 changed files with 236 additions and 44 deletions

View File

@ -5,5 +5,6 @@ talk to server side applications via the [`antd-tunnel-pligin`](https://github.c
using a single websocket API. using a single websocket API.
## Changes log ## Changes log
- v0.1.9-b Use the new client size minima frame format (reduces frame overhead)
- v0.1.4-a Reduce frame overhead - v0.1.4-a Reduce frame overhead
- v0.1.3-a Remove magic number in the frame to reduce frame overhead - v0.1.3-a Remove magic number in the frame to reduce frame overhead

View File

@ -5,5 +5,6 @@ talk to server side applications via the [`antd-tunnel-pligin`](https://github.c
using a single websocket API. using a single websocket API.
## Changes log ## Changes log
- v0.1.9-b Use the new client size minima frame format (reduces frame overhead)
- v0.1.4-a Reduce frame overhead - v0.1.4-a Reduce frame overhead
- v0.1.3-a Remove magic number in the frame to reduce frame overhead - v0.1.3-a Remove magic number in the frame to reduce frame overhead

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"email": "xsang.le@lxsang.me" "email": "xsang.le@lxsang.me"
}, },
"version":"0.1.8-a", "version":"0.1.9-b",
"category":"Library", "category":"Library",
"iconclass":"fa fa-adn", "iconclass":"fa fa-adn",
"mimes":["none"], "mimes":["none"],

Binary file not shown.

View File

@ -12,33 +12,27 @@ class Msg
as_raw:() -> as_raw:() ->
length = 13 + @header.size length = 5 + @header.size
arr = new Uint8Array(length) arr = new Uint8Array(length)
arr.set(Msg.MAGIC_START, 0) arr[0] = @header.type
arr[2] = @header.type
bytes = Msg.bytes_of @header.cid bytes = Msg.bytes_of @header.cid
arr.set(bytes,3) arr.set(bytes,1)
bytes = Msg.bytes_of @header.sid bytes = Msg.bytes_of @header.sid
arr.set(bytes,5) arr.set(bytes,3)
bytes = Msg.bytes_of @header.size, 4
arr.set(bytes,7)
if @data if @data
arr.set(@data, 11) arr.set(@data, 5)
arr.set(Msg.MAGIC_END, @header.size + 11)
arr.buffer arr.buffer
Msg.decode = (raw) -> Msg.decode = (raw) ->
new Promise (resolve, reject) -> new Promise (resolve, reject) ->
msg = new Msg() msg = new Msg()
if(Msg.int_from(Msg.MAGIC_START, 0) != Msg.int_from(raw, 0)) if(not raw or raw.length < 5)
return reject("Unmatch message begin magic number") return reject("Invalid message format")
msg.header.type = raw[2] msg.header.type = raw[0]
msg.header.cid = Msg.int_from(raw, 3) msg.header.cid = Msg.int_from(raw, 1)
msg.header.sid = Msg.int_from(raw,5) msg.header.sid = Msg.int_from(raw,3)
msg.header.size = Msg.int_from(raw, 7,4) msg.header.size = raw.length - 5
msg.data = raw.slice(11, 11+msg.header.size) msg.data = raw.slice(5, 5+msg.header.size)
if(Msg.int_from(Msg.MAGIC_END, 0) != Msg.int_from(raw, 11+msg.header.size))
return reject("Unmatch message end magic number")
resolve msg resolve msg
@ -67,8 +61,6 @@ Msg.SUBSCRIBE = 2
Msg.UNSUBSCRIBE = 3 Msg.UNSUBSCRIBE = 3
Msg.CTRL = 7 Msg.CTRL = 7
Msg.PING = 8 Msg.PING = 8
Msg.MAGIC_END = [0x44, 0x54]
Msg.MAGIC_START = [0x4e, 0x41 ]
class Subscriber class Subscriber
constructor: (@channel) -> constructor: (@channel) ->

View File

@ -9,7 +9,7 @@
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"email": "xsang.le@lxsang.me" "email": "xsang.le@lxsang.me"
}, },
"version":"0.1.8-a", "version":"0.1.9-b",
"category":"Library", "category":"Library",
"iconclass":"fa fa-adn", "iconclass":"fa fa-adn",
"mimes":["none"], "mimes":["none"],

View File

@ -6,5 +6,6 @@ using Antunnel protocol. Features:
* Recording last n log messages * Recording last n log messages
## Change logs ## Change logs
* v0.1.2-b update dependencies to latest
* v0.1.1-b minor fix on dialog handling, fix incorrect package version * v0.1.1-b minor fix on dialog handling, fix incorrect package version
* v0.1.0-b first beta version * v0.1.0-b first beta version

View File

@ -6,5 +6,6 @@ using Antunnel protocol. Features:
* Recording last n log messages * Recording last n log messages
## Change logs ## Change logs
* v0.1.2-b update dependencies to latest
* v0.1.1-b minor fix on dialog handling, fix incorrect package version * v0.1.1-b minor fix on dialog handling, fix incorrect package version
* v0.1.0-b first beta version * v0.1.0-b first beta version

View File

@ -7,12 +7,12 @@
"author": "", "author": "",
"email": "" "email": ""
}, },
"version":"0.1.1-b", "version":"0.1.2-b",
"category":"System", "category":"System",
"iconclass":"bi bi-receipt-cutoff", "iconclass":"bi bi-receipt-cutoff",
"mimes":["none"], "mimes":["none"],
"dependencies": [ "dependencies": [
"Antunnel@0.1.8-a" "Antunnel@0.1.9-b"
], ],
"locale": {} "locale": {}
} }

View File

@ -7,12 +7,12 @@
"author": "", "author": "",
"email": "" "email": ""
}, },
"version":"0.1.1-b", "version":"0.1.2-b",
"category":"System", "category":"System",
"iconclass":"bi bi-receipt-cutoff", "iconclass":"bi bi-receipt-cutoff",
"mimes":["none"], "mimes":["none"],
"dependencies": [ "dependencies": [
"Antunnel@0.1.8-a" "Antunnel@0.1.9-b"
], ],
"locale": {} "locale": {}
} }

114
SystemControl/build.json Normal file
View File

@ -0,0 +1,114 @@
{
"name": "SystemControl",
"targets": {
"init": {
"jobs": [
{
"name": "vfs-mkdir",
"data": [
"build",
"build/debug",
"build/release"
]
}
]
},
"coffee": {
"require": [
"coffee"
],
"jobs": [
{
"name": "coffee-compile",
"data": {
"src": [
"coffees/SysmondService.coffee",
"coffees/main.coffee"
],
"dest": "build/debug/coffee-main.js"
}
}
]
},
"cat": {
"jobs": [
{
"name": "vfs-cat",
"data": {
"src": [
"build/debug/coffee-main.js",
"javascripts/d3.v3.js",
"javascripts/epoch.js"
],
"dest": "build/debug/main.js"
}
},
{
"name": "vfs-cat",
"data": {
"src": [
"css/epoch.css",
"css/main.css"
],
"dest": "build/debug/main.css"
}
},
{
"name": "vfs-rm",
"data": [
"build/debug/coffee-main.js"
]
}
]
},
"uglify": {
"require": [
"terser"
],
"jobs": [
{
"name": "terser-uglify",
"data": [
"build/debug/main.js"
]
}
]
},
"copy": {
"jobs": [
{
"name": "vfs-cp",
"data": {
"src": [
"assets/scheme.html",
"package.json",
"README.md"
],
"dest": "build/debug"
}
}
]
},
"release": {
"require": [
"zip"
],
"depend": [
"init",
"coffee",
"cat",
"uglify",
"copy"
],
"jobs": [
{
"name": "zip-mk",
"data": {
"src": "build/debug",
"dest": "build/release/SystemControl.zip"
}
}
]
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -11,9 +11,9 @@
"email": "" "email": ""
}, },
"dependencies": [ "dependencies": [
"Antunnel@0.1.8-a" "Antunnel@0.1.9-b"
], ],
"version":"0.1.9-a", "version":"0.1.10-a",
"category":"System", "category":"System",
"iconclass":"fa fa-tachometer", "iconclass":"fa fa-tachometer",
"mimes":["none"], "mimes":["none"],

View File

@ -11,9 +11,9 @@
"email": "" "email": ""
}, },
"dependencies": [ "dependencies": [
"Antunnel@0.1.8-a" "Antunnel@0.1.9-b"
], ],
"version":"0.1.9-a", "version":"0.1.10-a",
"category":"System", "category":"System",
"iconclass":"fa fa-tachometer", "iconclass":"fa fa-tachometer",
"mimes":["none"], "mimes":["none"],

View File

@ -55,7 +55,7 @@
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Antunnel/README.md", "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Antunnel/README.md",
"category": "Library", "category": "Library",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.1.8-a", "version": "0.1.9-b",
"dependencies": [], "dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Antunnel/build/release/Antunnel.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Antunnel/build/release/Antunnel.zip"
}, },
@ -335,8 +335,8 @@
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ServerLogClient/README.md", "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ServerLogClient/README.md",
"category": "System", "category": "System",
"author": "", "author": "",
"version": "0.1.1-b", "version": "0.1.2-b",
"dependencies": ["Antunnel@0.1.8-a"], "dependencies": ["Antunnel@0.1.9-b"],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ServerLogClient/build/release/ServerLogClient.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/ServerLogClient/build/release/ServerLogClient.zip"
}, },
{ {
@ -375,8 +375,8 @@
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/SystemControl/README.md", "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/SystemControl/README.md",
"category": "System", "category": "System",
"author": "", "author": "",
"version": "0.1.9-a", "version": "0.1.10-a",
"dependencies": ["Antunnel@0.1.8-a"],"version":"0.1.9-a","category":"System","iconclass":"fafa-tachometer","mimes":["none"], "dependencies": ["Antunnel@0.1.9-b"],"version":"0.1.10-a","category":"System","iconclass":"fafa-tachometer","mimes":["none"],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/SystemControl/build/release/SystemControl.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/SystemControl/build/release/SystemControl.zip"
}, },
{ {
@ -415,8 +415,8 @@
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/vTerm/README.md", "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/vTerm/README.md",
"category": "System", "category": "System",
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"version": "0.1.14-a", "version": "0.1.15-a",
"dependencies": ["Antunnel@0.1.8-a","xTerm@4.8.1-r"], "dependencies": ["Antunnel@0.1.9-b","xTerm@4.8.1-r"],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/vTerm/build/release/vTerm.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/vTerm/build/release/vTerm.zip"
}, },
{ {

View File

@ -12,6 +12,7 @@ VTerm depends on the server side **tunnel** plugin and the AntOS **Antunnel**
client side package client side package
## Change logs ## Change logs
-v0.1.15-a update dependencies to latest
- v0.1.14-a: Change app icon - v0.1.14-a: Change app icon
- v0.1.12-a: Add copy/paste shortcuts (CTRL+SHIFT+C/ CTRL+SHIFT+V) - v0.1.12-a: Add copy/paste shortcuts (CTRL+SHIFT+C/ CTRL+SHIFT+V)
- v0.1.9-a: Update dependencies to latest - v0.1.9-a: Update dependencies to latest

81
vTerm/build.json Normal file
View File

@ -0,0 +1,81 @@
{
"name": "vTerm",
"targets": {
"init": {
"jobs": [
{
"name": "vfs-mkdir",
"data": [
"build",
"build/debug",
"build/release"
]
}
]
},
"coffee": {
"require": [
"coffee"
],
"jobs": [
{
"name": "coffee-compile",
"data": {
"src": [
"main.coffee"
],
"dest": "build/debug/main.js"
}
}
]
},
"uglify": {
"require": [
"terser"
],
"jobs": [
{
"name": "terser-uglify",
"data": [
"build/debug/main.js"
]
}
]
},
"copy": {
"jobs": [
{
"name": "vfs-cp",
"data": {
"src": [
"scheme.html",
"package.json",
"README.md"
],
"dest": "build/debug"
}
}
]
},
"release": {
"require": [
"zip"
],
"depend": [
"init",
"coffee",
"uglify",
"copy"
],
"jobs": [
{
"name": "zip-mk",
"data": {
"src": "build/debug",
"dest": "build/release/vTerm.zip"
}
}
]
}
}
}

View File

@ -12,6 +12,7 @@ VTerm depends on the server side **tunnel** plugin and the AntOS **Antunnel**
client side package client side package
## Change logs ## Change logs
-v0.1.15-a update dependencies to latest
- v0.1.14-a: Change app icon - v0.1.14-a: Change app icon
- v0.1.12-a: Add copy/paste shortcuts (CTRL+SHIFT+C/ CTRL+SHIFT+V) - v0.1.12-a: Add copy/paste shortcuts (CTRL+SHIFT+C/ CTRL+SHIFT+V)
- v0.1.9-a: Update dependencies to latest - v0.1.9-a: Update dependencies to latest

View File

@ -1 +0,0 @@

View File

@ -6,12 +6,12 @@
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"email": "xsang.le@gmail.com" "email": "xsang.le@gmail.com"
}, },
"version":"0.1.14-a", "version":"0.1.15-a",
"category":"System", "category":"System",
"iconclass":"bi bi-terminal-fill", "iconclass":"bi bi-terminal-fill",
"mimes":["none"], "mimes":["none"],
"dependencies": [ "dependencies": [
"Antunnel@0.1.8-a", "Antunnel@0.1.9-b",
"xTerm@4.8.1-r" "xTerm@4.8.1-r"
], ],
"locales":{ "locales":{

Binary file not shown.

Binary file not shown.

View File

View File

@ -6,12 +6,12 @@
"author": "Xuan Sang LE", "author": "Xuan Sang LE",
"email": "xsang.le@gmail.com" "email": "xsang.le@gmail.com"
}, },
"version":"0.1.14-a", "version":"0.1.15-a",
"category":"System", "category":"System",
"iconclass":"bi bi-terminal-fill", "iconclass":"bi bi-terminal-fill",
"mimes":["none"], "mimes":["none"],
"dependencies": [ "dependencies": [
"Antunnel@0.1.8-a", "Antunnel@0.1.9-b",
"xTerm@4.8.1-r" "xTerm@4.8.1-r"
], ],
"locales":{ "locales":{