wireshade 1.0.0
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/.github/workflows/publish.yml +111 -0
- package/Cargo.lock +1238 -0
- package/Cargo.toml +27 -0
- package/LICENSE +21 -0
- package/README.de.md +256 -0
- package/README.es.md +109 -0
- package/README.fr.md +109 -0
- package/README.md +258 -0
- package/README.zh.md +109 -0
- package/build.rs +5 -0
- package/examples/01_quickstart.js +36 -0
- package/examples/02_http_request.js +44 -0
- package/examples/03_https_custom_dns.js +47 -0
- package/examples/04_tcp_socket.js +50 -0
- package/examples/05_internet_routing.js +33 -0
- package/examples/06_simple_server.js +40 -0
- package/examples/07_express_app.js +37 -0
- package/examples/08_local_forwarding.js +30 -0
- package/examples/09_reconnect_config.js +128 -0
- package/examples/10_remote_forwarding.js +63 -0
- package/examples/README.md +54 -0
- package/examples/_legacy_easy_api.js +53 -0
- package/examples/wireguard.conf +8 -0
- package/index.d.ts +0 -0
- package/index.js +29 -0
- package/lib/agent.js +116 -0
- package/lib/client.js +548 -0
- package/lib/config_parser.js +77 -0
- package/lib/server.js +121 -0
- package/package.json +31 -0
- package/parallel_output.txt +0 -0
- package/src/lib.rs +841 -0
- package/wireshade.darwin-arm64.node +0 -0
- package/wireshade.darwin-x64.node +0 -0
- package/wireshade.linux-arm-gnueabihf.node +0 -0
- package/wireshade.linux-arm64-gnu.node +0 -0
- package/wireshade.linux-x64-gnu.node +0 -0
- package/wireshade.win32-x64-msvc.node +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
name: Build and Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
tags:
|
|
8
|
+
- 'v*'
|
|
9
|
+
pull_request:
|
|
10
|
+
|
|
11
|
+
env:
|
|
12
|
+
DEBUG: 'napi:*'
|
|
13
|
+
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build:
|
|
17
|
+
name: Build ${{ matrix.settings.target }}
|
|
18
|
+
runs-on: ${{ matrix.settings.host }}
|
|
19
|
+
strategy:
|
|
20
|
+
fail-fast: false
|
|
21
|
+
matrix:
|
|
22
|
+
settings:
|
|
23
|
+
- host: windows-latest
|
|
24
|
+
target: x86_64-pc-windows-msvc
|
|
25
|
+
build: npm run build
|
|
26
|
+
- host: ubuntu-latest
|
|
27
|
+
target: x86_64-unknown-linux-gnu
|
|
28
|
+
zig: true
|
|
29
|
+
build: npm run build -- --target x86_64-unknown-linux-gnu --cross-compile
|
|
30
|
+
- host: ubuntu-latest
|
|
31
|
+
target: aarch64-unknown-linux-gnu
|
|
32
|
+
zig: true
|
|
33
|
+
build: npm run build -- --target aarch64-unknown-linux-gnu --cross-compile
|
|
34
|
+
- host: ubuntu-latest
|
|
35
|
+
target: armv7-unknown-linux-gnueabihf
|
|
36
|
+
zig: true
|
|
37
|
+
build: npm run build -- --target armv7-unknown-linux-gnueabihf --cross-compile
|
|
38
|
+
- host: macos-latest
|
|
39
|
+
target: x86_64-apple-darwin
|
|
40
|
+
build: npm run build -- --target x86_64-apple-darwin
|
|
41
|
+
- host: macos-latest
|
|
42
|
+
target: aarch64-apple-darwin
|
|
43
|
+
build: npm run build -- --target aarch64-apple-darwin
|
|
44
|
+
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v4
|
|
47
|
+
|
|
48
|
+
- name: Setup node
|
|
49
|
+
uses: actions/setup-node@v4
|
|
50
|
+
with:
|
|
51
|
+
node-version: 20
|
|
52
|
+
cache: npm
|
|
53
|
+
|
|
54
|
+
- name: Install Rust
|
|
55
|
+
uses: dtolnay/rust-toolchain@stable
|
|
56
|
+
with:
|
|
57
|
+
toolchain: stable
|
|
58
|
+
targets: ${{ matrix.settings.target }}
|
|
59
|
+
|
|
60
|
+
- name: Install Zig
|
|
61
|
+
if: ${{ matrix.settings.zig }}
|
|
62
|
+
uses: goto-bus-stop/setup-zig@v2
|
|
63
|
+
with:
|
|
64
|
+
version: 0.13.0
|
|
65
|
+
|
|
66
|
+
- name: Install Dependencies
|
|
67
|
+
run: npm install
|
|
68
|
+
|
|
69
|
+
- name: Build
|
|
70
|
+
run: ${{ matrix.settings.build }}
|
|
71
|
+
|
|
72
|
+
- name: Upload artifacts
|
|
73
|
+
uses: actions/upload-artifact@v4
|
|
74
|
+
with:
|
|
75
|
+
name: bindings-${{ matrix.settings.target }}
|
|
76
|
+
path: wireshade.*.node
|
|
77
|
+
if-no-files-found: error
|
|
78
|
+
|
|
79
|
+
publish:
|
|
80
|
+
name: Publish to npm
|
|
81
|
+
runs-on: ubuntu-latest
|
|
82
|
+
needs: build
|
|
83
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
84
|
+
steps:
|
|
85
|
+
- uses: actions/checkout@v4
|
|
86
|
+
|
|
87
|
+
- name: Setup node
|
|
88
|
+
uses: actions/setup-node@v4
|
|
89
|
+
with:
|
|
90
|
+
node-version: 20
|
|
91
|
+
registry-url: 'https://registry.npmjs.org'
|
|
92
|
+
|
|
93
|
+
- name: Install Dependencies
|
|
94
|
+
run: npm install
|
|
95
|
+
|
|
96
|
+
- name: Download all artifacts
|
|
97
|
+
uses: actions/download-artifact@v4
|
|
98
|
+
with:
|
|
99
|
+
path: artifacts
|
|
100
|
+
|
|
101
|
+
- name: Move artifacts
|
|
102
|
+
run: |
|
|
103
|
+
mv artifacts/bindings-*/wireshade.*.node .
|
|
104
|
+
ls -R wireshade.*.node
|
|
105
|
+
|
|
106
|
+
- name: Publish
|
|
107
|
+
env:
|
|
108
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
109
|
+
run: |
|
|
110
|
+
npm publish
|
|
111
|
+
echo "Successfully published to npm"
|