Skip to content

Commit fb498e4

Browse files
committed
恢复使用全协议
1 parent 0f63299 commit fb498e4

File tree

3 files changed

+47
-16
lines changed

3 files changed

+47
-16
lines changed

.vscode/launch.json

+12-9
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
// 悬停以查看现有属性的描述。
44
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
6-
"configurations": [{
7-
"type": "node",
8-
"request": "launch",
9-
"name": "启动程序",
10-
"program": "${workspaceFolder}/dist/test.js",
11-
"outFiles": [
12-
"${workspaceFolder}/**/*.js"
13-
]
14-
}]
6+
"configurations": [
7+
8+
{
9+
"type": "node",
10+
"request": "launch",
11+
"name": "启动程序",
12+
"program": "${workspaceFolder}/dist/test.js",
13+
"outFiles": [
14+
"${workspaceFolder}/**/*.js"
15+
]
16+
}
17+
]
1518
}

src/index.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ export class RPC {
5858
return Buffer.concat([
5959
Buffer.from([0x68]),
6060
b,
61-
this.Type == RPCType.Proxy ? Buffer.from(From) : Buffer.alloc(0),
62-
this.Type == RPCType.Proxy ? Buffer.from(To) : Buffer.alloc(0),
61+
// this.Type == RPCType.Proxy ? Buffer.from(From) : Buffer.alloc(0),
62+
// this.Type == RPCType.Proxy ? Buffer.from(To) : Buffer.alloc(0),
63+
Buffer.from(From),
64+
Buffer.from(To),
6365
Buffer.from(this.Path),
6466
Buffer.from(data),
6567
Buffer.from([0x68]),
@@ -88,11 +90,11 @@ export class RPC {
8890

8991
t.Time = Number(tTime.join(''))
9092
let start = 20;
91-
if (t.Type == RPCType.Proxy) {
92-
t.From = b.slice(20, 20 + 8).toString().trim()
93-
t.To = b.slice(20 + 8, 20 + 8 + 8).toString().trim()
94-
start = 36;
95-
}
93+
// if (t.Type == RPCType.Proxy) {
94+
t.From = b.slice(20, 20 + 8).toString().trim()
95+
t.To = b.slice(20 + 8, 20 + 8 + 8).toString().trim()
96+
start = 36;
97+
// }
9698
//预留7个字节不处理
9799
t.Path = b.slice(start, len + start).toString()
98100
t.Data = b.slice(start + len)

yarn.lock

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
5+
"@types/node@^10.12.2":
6+
version "10.12.10"
7+
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.10.tgz#4fa76e6598b7de3f0cb6ec3abacc4f59e5b3a2ce"
8+
integrity sha512-8xZEYckCbUVgK8Eg7lf5Iy4COKJ5uXlnIOnePN0WUwSQggy9tolM+tDJf7wMOnT/JT/W9xDYIaYggt3mRV2O5w==
9+
10+
base64-js@^1.0.2:
11+
version "1.3.0"
12+
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3"
13+
integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==
14+
15+
buffer@^5.2.0:
16+
version "5.2.1"
17+
resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6"
18+
integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==
19+
dependencies:
20+
base64-js "^1.0.2"
21+
ieee754 "^1.1.4"
22+
23+
ieee754@^1.1.4:
24+
version "1.1.12"
25+
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b"
26+
integrity sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==

0 commit comments

Comments
 (0)