reqrio 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2.log +10 -0
- package/bindings.js +5 -2
- package/index.js +1 -1
- package/libreqrio.so +0 -0
- package/package.json +1 -1
- package/reqrio.dll +0 -0
- package/session.js +6 -1
- package/test.js +1 -1
package/2.log
CHANGED
|
@@ -26,3 +26,13 @@ CLIENT_RANDOM d89265054fb145fe75fe56e224a0aac9acd23a87221c95a7b5bc0d2f94945750 a
|
|
|
26
26
|
CLIENT_RANDOM c2afc383b0363f37dd448ef95aa30a8c12ec8f515e321679f70b37cd82f74836 e0bde036e403ae0cd4111db98b4ef6ee82634faccf0414392ab782ccd88e7cefe6d66db6995f5aa18f7e0a96c582b409
|
|
27
27
|
CLIENT_RANDOM b009e5252d97d5086723bf3ed3788000c167900c6f060449feaf2262045f69df 673f5759883a46a6f0116266a2ca24f5c217cb96360bd42ec244ad282fb92d1e636db9e438b61edae05541effdce6c60
|
|
28
28
|
CLIENT_RANDOM 547e11d441719d61c836cdd53f55a0828cbf9c8b1dfb7da104f890f16c2ac781 e6e67b5ea27eca02afeaee0786b285c33c90531c4e8c4b6e72c90e6897c4c66fc6c7c5305eec14e37414094a43f67adf
|
|
29
|
+
CLIENT_RANDOM 622c86402ae3439f0cf70aa614f8be142f221006dae4f12cfb3f77381d770e86 431c70971d631a265a863d39466bd1c29bc2de9c7e07aadf52c22bb556021308213cc920819b7360455344832c223adf
|
|
30
|
+
CLIENT_RANDOM 7f80dcd4bea6bbd923d31957b971374657980c3ca82177ab2fac70da8df2d39d 8e0cb6dbbe19e3dcd45fafd416fb5ab8d66a9cd4da24e2e03f38464e5e94dac58c329837b16ec7201712422523aa63d6
|
|
31
|
+
CLIENT_RANDOM 7ef0b7e7eb064374dd8652a23cd512099314453fa4a6df5f4bd9bc595b27ba77 b07f474bba1a40e39f97920251674e378cef38ee3ea1d4dab7d66cc834e126c9dbd7a77c341fc7c7182364f230752c2a
|
|
32
|
+
CLIENT_RANDOM ed71850a389c5f29eecb1cac882d0e62ce9b55dfc8bdc7404e2f3d2ffa9aaa31 080f7b03f5c49a12cc1927e0c3723e682eefd1d9f5d833ed211fceace61f7f3415fcc1e6689fda2d4efb8554ad7eaa71
|
|
33
|
+
CLIENT_RANDOM 6519336c53f75305cc1219d2e26379f2e81dd8a4f4bacc324305a561df6a94d7 c5c04fb38483c08046bd80f2b5749d1c88f84d016bbf1c38a3b84a77e92ef23f2c81829386ac89016de86a91f0bef7b2
|
|
34
|
+
CLIENT_RANDOM 09647f892d211ce87245475a18dfb8466847a994e9b971e10a293b0d9a630bd9 a94afea9447ee119432d21c850f1dea431926ab4168c8ce6f1b03daf0852fcf436a668b4843088b9cc698884a6b9a5e1
|
|
35
|
+
CLIENT_RANDOM 40c4a4038db16498b18defb475f76eb960fab4d7c3cb614e6e1f7992df9e98f0 411fdd4cc4176ec2efc23f0b07c935b9bf72ee3e4997b572b3a7e6faffb196daab9277a32c037b81b3f645a7434abe8a
|
|
36
|
+
CLIENT_RANDOM 966ed32241c38b1d168bc87b4789e52401c588746c4ad42e29975d0ff49b363c c5a52901916cd4c993e7f774b97174d4cef2a1be24f3cf0675ab866b80dab69140f290a99dd3c307ac6dbeb01f4e4ead
|
|
37
|
+
CLIENT_RANDOM 6f71074305989527086d8ebce133d155a85b232bdc474f9fb1e18aa005031adb ad1d2821354848d10703f04647ca324438fc5e2df60639b3db89082f0995590f0d88ac9d613039a7e885eb97ad9392c9
|
|
38
|
+
CLIENT_RANDOM 58329af12e3a0c20da02cd91e8add6cff9e296e6432791f77afdc02c6e2c8189 833119fc15c1d797632bd86ba840f1bcbe8214e8e7a88ab46881b6d388f735d268045f19902a694cda9aa9c85f3c4d86
|
package/bindings.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const ffi = require('ffi-napi');
|
|
2
2
|
const ref = require('ref-napi');
|
|
3
|
+
const path = require("path");
|
|
3
4
|
|
|
4
5
|
const voidPtr = ref.refType(ref.types.void);
|
|
5
6
|
const charPtr = ref.types.CString;
|
|
@@ -14,6 +15,7 @@ const Method = {
|
|
|
14
15
|
OPTIONS: 5,
|
|
15
16
|
TRACE: 6,
|
|
16
17
|
CONNECT: 7,
|
|
18
|
+
PATCH: 8
|
|
17
19
|
}
|
|
18
20
|
let libname;
|
|
19
21
|
if (process.platform === "win32") {
|
|
@@ -23,12 +25,13 @@ if (process.platform === "win32") {
|
|
|
23
25
|
} else {
|
|
24
26
|
throw "unsupported system platform"
|
|
25
27
|
}
|
|
26
|
-
|
|
27
|
-
const library = ffi.Library(
|
|
28
|
+
let libpath = path.join(__dirname, libname)
|
|
29
|
+
const library = ffi.Library(libpath, {
|
|
28
30
|
ScReq_new: [voidPtr, []],
|
|
29
31
|
ScReq_set_header_json: ['int', [voidPtr, charPtr]],
|
|
30
32
|
ScReq_add_header: ["int", [voidPtr, charPtr, charPtr]],
|
|
31
33
|
ScReq_set_alpn: ["int", [voidPtr, charPtr]],
|
|
34
|
+
ScReq_set_verify: ["int", [voidPtr, 'bool']],
|
|
32
35
|
ScReq_set_random_fingerprint: ["int", [voidPtr, charPtr]],
|
|
33
36
|
ScReq_set_fingerprint: ["int", [voidPtr, charPtr, charPtr]],
|
|
34
37
|
ScReq_set_ja3: ["int", [voidPtr, charPtr, charPtr]],
|
package/index.js
CHANGED
package/libreqrio.so
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/reqrio.dll
CHANGED
|
Binary file
|
package/session.js
CHANGED
|
@@ -12,7 +12,7 @@ const registry = new FinalizationRegistry(req => {
|
|
|
12
12
|
})
|
|
13
13
|
|
|
14
14
|
class Session {
|
|
15
|
-
constructor(alpn, rand_tls, token) {
|
|
15
|
+
constructor(alpn, rand_tls, token, verify = true) {
|
|
16
16
|
this.req = library.ScReq_new();
|
|
17
17
|
if (alpn) {
|
|
18
18
|
let ret = library.ScReq_set_alpn(this.req, alpn)
|
|
@@ -23,6 +23,7 @@ class Session {
|
|
|
23
23
|
if (ret === -2) console.log("free user, set_random_fingerprint can't be used")
|
|
24
24
|
if (ret === -1) throw "set_random_fingerprint error"
|
|
25
25
|
}
|
|
26
|
+
library.ScReq_set_verify(this.req, verify)
|
|
26
27
|
registry.register(this, this.req)
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -164,6 +165,10 @@ class Session {
|
|
|
164
165
|
return this.send(Method.DELETE)
|
|
165
166
|
}
|
|
166
167
|
|
|
168
|
+
patch() {
|
|
169
|
+
return this.send(Method.PATCH)
|
|
170
|
+
}
|
|
171
|
+
|
|
167
172
|
close() {
|
|
168
173
|
registry.unregister(this);
|
|
169
174
|
library.ScReq_drop(this.req)
|
package/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const {Session, ALPN, Websocket} = require('./index')
|
|
2
2
|
|
|
3
|
-
let session = new Session(ALPN.HTTP20, true, "sd");
|
|
3
|
+
let session = new Session(ALPN.HTTP20, true, "sd", false);
|
|
4
4
|
session.set_url("https://m.so.com");
|
|
5
5
|
session.set_callback(function (data) {
|
|
6
6
|
console.log(data.length)
|