tcpip 0.1.1-dev.1 → 0.1.1-dev.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/dist/cjs/index.js +26 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/platforms/{browser.js → bundler.js} +2 -2
- package/dist/cjs/platforms/bundler.js.map +1 -0
- package/dist/esm/index.js +11 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/platforms/{browser.js → bundler.js} +2 -2
- package/dist/esm/platforms/bundler.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +11 -10
- package/dist/cjs/platforms/browser.js.map +0 -1
- package/dist/cjs/platforms/deno.js +0 -76
- package/dist/cjs/platforms/deno.js.map +0 -1
- package/dist/esm/platforms/browser.js.map +0 -1
- package/dist/esm/platforms/deno.js +0 -8
- package/dist/esm/platforms/deno.js.map +0 -1
- package/dist/types/platforms/deno.d.ts +0 -2
- /package/dist/types/platforms/{browser.d.ts → bundler.d.ts} +0 -0
package/dist/cjs/index.js
CHANGED
|
@@ -62,7 +62,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
62
62
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
63
|
};
|
|
64
64
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
exports.init = exports.Stack = exports.TunInterface = exports.TapInterface = exports.LoopbackInterface = void 0;
|
|
65
|
+
exports.initFrom = exports.init = exports.Stack = exports.TunInterface = exports.TapInterface = exports.LoopbackInterface = void 0;
|
|
66
|
+
var wasm_exec_js_1 = __importDefault(require("./go/wasm_exec.js"));
|
|
66
67
|
var loopback_interface_js_1 = __importDefault(require("./interfaces/loopback-interface.js"));
|
|
67
68
|
var tap_interface_js_1 = __importDefault(require("./interfaces/tap-interface.js"));
|
|
68
69
|
var tun_interface_js_1 = __importDefault(require("./interfaces/tun-interface.js"));
|
|
@@ -88,10 +89,31 @@ var tcpipNamespace = {
|
|
|
88
89
|
};
|
|
89
90
|
// TODO: find a way to pass this directly to WASM via import object
|
|
90
91
|
globalThis['@tcpip/stack'] = tcpipNamespace;
|
|
92
|
+
// Implemented per platform
|
|
91
93
|
function init() {
|
|
92
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
93
|
-
return
|
|
94
|
-
|
|
94
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
95
|
+
return __generator(this, function (_a) {
|
|
96
|
+
throw new Error('init() not implemented on this platform - use initFrom()');
|
|
97
|
+
});
|
|
98
|
+
});
|
|
95
99
|
}
|
|
96
100
|
exports.init = init;
|
|
101
|
+
// Escape hatch to import WASM file manually
|
|
102
|
+
function initFrom(wasm) {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
104
|
+
var go, instance;
|
|
105
|
+
return __generator(this, function (_a) {
|
|
106
|
+
switch (_a.label) {
|
|
107
|
+
case 0:
|
|
108
|
+
go = new wasm_exec_js_1.default();
|
|
109
|
+
return [4 /*yield*/, WebAssembly.instantiate(wasm, go.importObject)];
|
|
110
|
+
case 1:
|
|
111
|
+
instance = _a.sent();
|
|
112
|
+
go.run(instance);
|
|
113
|
+
return [2 /*return*/];
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
exports.initFrom = initFrom;
|
|
97
119
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6FAAmE;AACnE,mFAAyD;AACzD,mFAAyD;AACzD,0DAAiC;AACjC,0DAAiC;AACjC,qDAA2C;AAE3C,4EAAkF;AAAzE,2IAAA,OAAO,OAAqB;AACrC,kEAAwE;AAA/D,iIAAA,OAAO,OAAgB;AAChC,kEAAw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AAE,CAAC,YAAY,CAAC,EAAA;;oBAA/D,QAAQ,GAAG,SAAoD;oBACrE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;;;;;CAClB;AAJD,4BAIC"}
|
|
@@ -63,7 +63,7 @@ function init() {
|
|
|
63
63
|
switch (_a.label) {
|
|
64
64
|
case 0:
|
|
65
65
|
go = new wasm_exec_js_1.default();
|
|
66
|
-
return [4 /*yield*/, WebAssembly.instantiateStreaming(fetch(require('tcpip/tcpip.wasm')), go.importObject)];
|
|
66
|
+
return [4 /*yield*/, WebAssembly.instantiateStreaming(fetch(require('tcpip/tcpip.wasm?module')), go.importObject)];
|
|
67
67
|
case 1:
|
|
68
68
|
source = _a.sent();
|
|
69
69
|
go.run(source.instance);
|
|
@@ -73,4 +73,4 @@ function init() {
|
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
exports.init = init;
|
|
76
|
-
//# sourceMappingURL=
|
|
76
|
+
//# sourceMappingURL=bundler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../../src/platforms/bundler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAoC;AACpC,8CAA4B;AAE5B,SAAsB,IAAI;;;;;;oBAClB,EAAE,GAAG,IAAI,sBAAE,EAAE,CAAC;oBACL,qBAAM,WAAW,CAAC,oBAAoB,CACnD,KAAK,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,EACzC,EAAE,CAAC,YAAY,CAChB,EAAA;;oBAHK,MAAM,GAAG,SAGd;oBACD,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;;;;;CACzB;AAPD,oBAOC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Go from './go/wasm_exec.js';
|
|
1
2
|
import LoopbackInterface from './interfaces/loopback-interface.js';
|
|
2
3
|
import TapInterface from './interfaces/tap-interface.js';
|
|
3
4
|
import TunInterface from './interfaces/tun-interface.js';
|
|
@@ -19,5 +20,14 @@ const tcpipNamespace = {
|
|
|
19
20
|
};
|
|
20
21
|
// TODO: find a way to pass this directly to WASM via import object
|
|
21
22
|
globalThis['@tcpip/stack'] = tcpipNamespace;
|
|
22
|
-
|
|
23
|
+
// Implemented per platform
|
|
24
|
+
export async function init() {
|
|
25
|
+
throw new Error('init() not implemented on this platform - use initFrom()');
|
|
26
|
+
}
|
|
27
|
+
// Escape hatch to import WASM file manually
|
|
28
|
+
export async function initFrom(wasm) {
|
|
29
|
+
const go = new Go();
|
|
30
|
+
const instance = await WebAssembly.instantiate(wasm, go.importObject);
|
|
31
|
+
go.run(instance);
|
|
32
|
+
}
|
|
23
33
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,oCAAoC,CAAC;AACnE,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAO,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnD,MAAM,cAAc,GAAG;IACrB,KAAK;IACL,iBAAiB;IACjB,YAAY;IACZ,YAAY;IACZ,M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,CAAC,YAAY,CAAC,CAAC;IACtE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACnB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import Go from '../go/wasm_exec.js';
|
|
|
2
2
|
export * from '../index.js';
|
|
3
3
|
export async function init() {
|
|
4
4
|
const go = new Go();
|
|
5
|
-
const source = await WebAssembly.instantiateStreaming(fetch(require('tcpip/tcpip.wasm')), go.importObject);
|
|
5
|
+
const source = await WebAssembly.instantiateStreaming(fetch(require('tcpip/tcpip.wasm?module')), go.importObject);
|
|
6
6
|
go.run(source.instance);
|
|
7
7
|
}
|
|
8
|
-
//# sourceMappingURL=
|
|
8
|
+
//# sourceMappingURL=bundler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../../src/platforms/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACpC,cAAc,aAAa,CAAC;AAE5B,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,CAAC;IACpB,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,oBAAoB,CACnD,KAAK,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,EACzC,EAAE,CAAC,YAAY,CAChB,CAAC;IACF,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export { default as TapInterface } from './interfaces/tap-interface.js';
|
|
|
3
3
|
export { default as TunInterface } from './interfaces/tun-interface.js';
|
|
4
4
|
export { Net, default as Stack } from './stack.js';
|
|
5
5
|
export declare function init(): Promise<void>;
|
|
6
|
+
export declare function initFrom(wasm: BufferSource | WebAssembly.Module): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tcpip",
|
|
3
|
-
"version": "0.1.1-dev.
|
|
3
|
+
"version": "0.1.1-dev.3",
|
|
4
4
|
"description": "Full TCP/IP stack in the browser",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rm -rf dist",
|
|
@@ -22,19 +22,20 @@
|
|
|
22
22
|
"module": "./dist/esm/platforms/node.js",
|
|
23
23
|
"default": "./dist/cjs/platforms/node.js"
|
|
24
24
|
},
|
|
25
|
-
"
|
|
26
|
-
"types": "./dist/types/platforms/
|
|
27
|
-
"module": "./dist/esm/platforms/
|
|
28
|
-
"default": "./dist/cjs/platforms/
|
|
25
|
+
"webpack": {
|
|
26
|
+
"types": "./dist/types/platforms/bundler.d.ts",
|
|
27
|
+
"module": "./dist/esm/platforms/bundler.js",
|
|
28
|
+
"default": "./dist/cjs/platforms/bundler.js"
|
|
29
29
|
},
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"default": "./dist/cjs/platforms/browser.js"
|
|
34
|
-
}
|
|
30
|
+
"types": "./dist/types/index.d.ts",
|
|
31
|
+
"module": "./dist/esm/index.js",
|
|
32
|
+
"default": "./dist/cjs/index.js"
|
|
35
33
|
},
|
|
36
34
|
"./tcpip.wasm": {
|
|
37
35
|
"default": "./dist/tcpip.wasm"
|
|
36
|
+
},
|
|
37
|
+
"./tcpip.wasm?module": {
|
|
38
|
+
"default": "./dist/tcpip.wasm?module"
|
|
38
39
|
}
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../src/platforms/browser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAoC;AACpC,8CAA4B;AAE5B,SAAsB,IAAI;;;;;;oBAClB,EAAE,GAAG,IAAI,sBAAE,EAAE,CAAC;oBACL,qBAAM,WAAW,CAAC,oBAAoB,CACnD,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,EAClC,EAAE,CAAC,YAAY,CAChB,EAAA;;oBAHK,MAAM,GAAG,SAGd;oBACD,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;;;;;CACzB;AAPD,oBAOC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
27
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
-
function step(op) {
|
|
30
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
-
switch (op[0]) {
|
|
35
|
-
case 0: case 1: t = op; break;
|
|
36
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
-
default:
|
|
40
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
-
if (t[2]) _.ops.pop();
|
|
45
|
-
_.trys.pop(); continue;
|
|
46
|
-
}
|
|
47
|
-
op = body.call(thisArg, _);
|
|
48
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
53
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
54
|
-
};
|
|
55
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
|
-
exports.init = void 0;
|
|
57
|
-
var wasm_exec_js_1 = __importDefault(require("../go/wasm_exec.js"));
|
|
58
|
-
__exportStar(require("../index.js"), exports);
|
|
59
|
-
function init() {
|
|
60
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
61
|
-
var go, instance;
|
|
62
|
-
return __generator(this, function (_a) {
|
|
63
|
-
switch (_a.label) {
|
|
64
|
-
case 0:
|
|
65
|
-
go = new wasm_exec_js_1.default();
|
|
66
|
-
return [4 /*yield*/, WebAssembly.instantiate(require('../../tcpip.wasm?module'), go.importObject)];
|
|
67
|
-
case 1:
|
|
68
|
-
instance = _a.sent();
|
|
69
|
-
go.run(instance);
|
|
70
|
-
return [2 /*return*/];
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
exports.init = init;
|
|
76
|
-
//# sourceMappingURL=deno.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deno.js","sourceRoot":"","sources":["../../../src/platforms/deno.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAoC;AACpC,8CAA4B;AAE5B,SAAsB,IAAI;;;;;;oBAClB,EAAE,GAAG,IAAI,sBAAE,EAAE,CAAC;oBACH,qBAAM,WAAW,CAAC,WAAW,CAC5C,OAAO,CAAC,yBAAyB,CAAuB,EACxD,EAAE,CAAC,YAAY,CAChB,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBACD,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;;;;;CAClB;AAPD,oBAOC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../src/platforms/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACpC,cAAc,aAAa,CAAC;AAE5B,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,CAAC;IACpB,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,oBAAoB,CACnD,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,EAClC,EAAE,CAAC,YAAY,CAChB,CAAC;IACF,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import Go from '../go/wasm_exec.js';
|
|
2
|
-
export * from '../index.js';
|
|
3
|
-
export async function init() {
|
|
4
|
-
const go = new Go();
|
|
5
|
-
const instance = await WebAssembly.instantiate(require('../../tcpip.wasm?module'), go.importObject);
|
|
6
|
-
go.run(instance);
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=deno.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deno.js","sourceRoot":"","sources":["../../../src/platforms/deno.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACpC,cAAc,aAAa,CAAC;AAE5B,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,CAAC;IACpB,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,WAAW,CAC5C,OAAO,CAAC,yBAAyB,CAAuB,EACxD,EAAE,CAAC,YAAY,CAChB,CAAC;IACF,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACnB,CAAC"}
|
|
File without changes
|