wireshade 1.0.0 → 1.0.5
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/README.de.md +7 -3
- package/README.es.md +2 -0
- package/README.fr.md +2 -0
- package/README.md +2 -0
- package/README.zh.md +2 -0
- package/lib/client.js +1 -1
- package/package.json +9 -1
- package/wireshade.win32-x64-msvc.node +0 -0
- package/.github/workflows/publish.yml +0 -111
- package/Cargo.lock +0 -1238
- package/Cargo.toml +0 -27
- package/build.rs +0 -5
- package/examples/01_quickstart.js +0 -36
- package/examples/02_http_request.js +0 -44
- package/examples/03_https_custom_dns.js +0 -47
- package/examples/04_tcp_socket.js +0 -50
- package/examples/05_internet_routing.js +0 -33
- package/examples/06_simple_server.js +0 -40
- package/examples/07_express_app.js +0 -37
- package/examples/08_local_forwarding.js +0 -30
- package/examples/09_reconnect_config.js +0 -128
- package/examples/10_remote_forwarding.js +0 -63
- package/examples/README.md +0 -54
- package/examples/_legacy_easy_api.js +0 -53
- package/examples/wireguard.conf +0 -8
- package/index.d.ts +0 -0
- package/parallel_output.txt +0 -0
- package/src/lib.rs +0 -841
package/README.de.md
CHANGED
|
@@ -60,12 +60,16 @@ await client.start();
|
|
|
60
60
|
### 1. HTTP/HTTPS Requests (Client)
|
|
61
61
|
Nutze WireShade als transparenten Agent für deine Requests.
|
|
62
62
|
|
|
63
|
+
> **Hinweis zu DNS:** Du kannst eigene Hostnamen wie `internal.service` direkt in der `hosts`-Konfiguration auf IP-Adressen mappen. WireShade löst diese Namen dann automatisch während des Requests auf.
|
|
64
|
+
|
|
63
65
|
**Vereinfachte API:**
|
|
64
66
|
```javascript
|
|
65
67
|
const html = await client.get('https://internal.service/api');
|
|
66
68
|
console.log(html);
|
|
67
69
|
```
|
|
68
70
|
|
|
71
|
+
> **Hinweis zu DNS:** Du kannst eigene Hostnamen wie `internal.service` direkt in der `hosts`-Konfiguration auf IP-Adressen mappen. WireShade löst diese Namen dann automatisch während des Requests auf.
|
|
72
|
+
|
|
69
73
|
**Natives `http`/`https` Modul:**
|
|
70
74
|
```javascript
|
|
71
75
|
const https = require('https');
|
|
@@ -184,7 +188,7 @@ console.log('VPN-Nutzer können deinen Server unter http://<VPN-IP>:8080 erreich
|
|
|
184
188
|
WireShade enthält robuste Logik für Reconnects.
|
|
185
189
|
|
|
186
190
|
```javascript
|
|
187
|
-
const client = new
|
|
191
|
+
const client = new WireShade({
|
|
188
192
|
wireguard: { ... },
|
|
189
193
|
reconnect: {
|
|
190
194
|
enabled: true,
|
|
@@ -201,7 +205,7 @@ client.on('reconnecting', (attempt) => console.log(`🔄 Verbinde neu... (${atte
|
|
|
201
205
|
Mappe interne VPN-Hostnamen auf IP-Adressen, ohne `/etc/hosts` anzufassen.
|
|
202
206
|
|
|
203
207
|
```javascript
|
|
204
|
-
const client = new
|
|
208
|
+
const client = new WireShade({
|
|
205
209
|
wireguard: { ... },
|
|
206
210
|
hosts: {
|
|
207
211
|
'intern-api.local': '10.0.0.4',
|
|
@@ -212,7 +216,7 @@ const client = new WireShadeClient({
|
|
|
212
216
|
|
|
213
217
|
## 📚 API Referenz
|
|
214
218
|
|
|
215
|
-
**`new
|
|
219
|
+
**`new WireShade(config)`**
|
|
216
220
|
- Erstellt eine neue VPN-Instanz. `config` entspricht den Standard-WireGuard-Parametern (`privateKey`, `endpoint`, etc.).
|
|
217
221
|
|
|
218
222
|
**`client.start()`**
|
package/README.es.md
CHANGED
|
@@ -45,6 +45,8 @@ await client.start();
|
|
|
45
45
|
### 1. Solicitudes HTTP/HTTPS (Cliente)
|
|
46
46
|
Usa WireShade como un agente transparente para tus solicitudes.
|
|
47
47
|
|
|
48
|
+
> **Nota sobre DNS:** Puedes mapear nombres de host personalizados como `internal.service` directamente a direcciones IP en la configuración de `hosts`. WireShade resolverá automáticamente estos nombres durante la solicitud.
|
|
49
|
+
|
|
48
50
|
**Módulo nativo `http`/`https`:**
|
|
49
51
|
```javascript
|
|
50
52
|
const https = require('https');
|
package/README.fr.md
CHANGED
|
@@ -45,6 +45,8 @@ await client.start();
|
|
|
45
45
|
### 1. Requêtes HTTP/HTTPS (Client)
|
|
46
46
|
Utilisez WireShade comme un agent transparent pour vos requêtes.
|
|
47
47
|
|
|
48
|
+
> **Note sur le DNS :** Vous pouvez mapper des noms d'hôtes personnalisés comme `internal.service` directement à des adresses IP dans la configuration `hosts`. WireShade résoudra automatiquement ces noms lors de la requête.
|
|
49
|
+
|
|
48
50
|
**Module natif `http`/`https` :**
|
|
49
51
|
```javascript
|
|
50
52
|
const https = require('https');
|
package/README.md
CHANGED
|
@@ -68,6 +68,8 @@ const html = await client.get('https://internal.service/api');
|
|
|
68
68
|
console.log(html);
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
> **Note on DNS:** You can map custom hostnames like `internal.service` directly to IP addresses in the `hosts` configuration. WireShade will automatically intercept and resolve these names during the request.
|
|
72
|
+
|
|
71
73
|
**Native `http`/`https` Module:**
|
|
72
74
|
```javascript
|
|
73
75
|
const https = require('https');
|
package/README.zh.md
CHANGED
|
@@ -45,6 +45,8 @@ await client.start();
|
|
|
45
45
|
### 1. HTTP/HTTPS请求 (客户端)
|
|
46
46
|
使用 WireShade 作为请求的透明代理。
|
|
47
47
|
|
|
48
|
+
> **关于 DNS 的说明:** 您可以在 `hosts` 配置中将 `internal.service` 等自定义主机名直接映射到 IP 地址。WireShade 将在请求期间自动拦截并解析这些名称。
|
|
49
|
+
|
|
48
50
|
**原生 `http`/`https` 模块:**
|
|
49
51
|
```javascript
|
|
50
52
|
const https = require('https');
|
package/lib/client.js
CHANGED
|
@@ -461,7 +461,7 @@ class WireShadeClient extends EventEmitter {
|
|
|
461
461
|
* Start a TCP server listener on the VPN interface
|
|
462
462
|
* @param {number} port
|
|
463
463
|
* @param {Function} [onConnection] - (socket) => void
|
|
464
|
-
* @returns {Promise<
|
|
464
|
+
* @returns {Promise<WireShadeServer>}
|
|
465
465
|
*/
|
|
466
466
|
async listen(port, onConnection) {
|
|
467
467
|
if (!this.gw) throw new Error("WireShade not initialized");
|
package/package.json
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wireshade",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"main": "index.js",
|
|
5
|
+
"files": [
|
|
6
|
+
"index.js",
|
|
7
|
+
"lib",
|
|
8
|
+
"wireshade.*.node",
|
|
9
|
+
"wireshade.node",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
5
13
|
"napi": {
|
|
6
14
|
"binaryName": "wireshade",
|
|
7
15
|
"targets": [
|
|
Binary file
|
|
@@ -1,111 +0,0 @@
|
|
|
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"
|