hbeam 0.1.8 → 0.1.9
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.md +95 -38
- package/dist/cli.mjs +1019 -135
- package/dist/cli.mjs.map +1 -1
- package/dist/package--LEE-eAz.mjs +6 -0
- package/dist/package--LEE-eAz.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/package-CsWKuqOT.mjs +0 -6
- package/dist/package-CsWKuqOT.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A 1-to-1 end-to-end encrypted pipe over [HyperDHT](https://github.com/holepunchto/hyperdht).
|
|
4
4
|
|
|
5
|
-
Pipe data between two machines through a peer-to-peer encrypted tunnel. No server, no accounts.
|
|
5
|
+
Pipe data between two machines through a peer-to-peer encrypted tunnel. No server, no accounts. By default, hbeam uses your persistent identity; use `--temp` for one-time passphrase sessions.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -12,55 +12,40 @@ npm install -g hbeam
|
|
|
12
12
|
|
|
13
13
|
## CLI
|
|
14
14
|
|
|
15
|
-
### Send
|
|
15
|
+
### Send (identity by default)
|
|
16
16
|
|
|
17
|
-
Pipe data in and hbeam
|
|
17
|
+
Pipe data in and hbeam announces using your persistent identity (created on first use at `~/.config/hbeam/identity.json`):
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
echo 'hello world' | hbeam
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
```
|
|
24
|
-
HBEAM ·····
|
|
25
|
-
PASSPHRASE
|
|
26
|
-
nbsk4wlqmfuw...
|
|
27
|
-
```
|
|
28
|
-
|
|
29
23
|
### Receive
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
Connect by saved name or public key:
|
|
32
26
|
|
|
33
27
|
```bash
|
|
34
|
-
hbeam
|
|
28
|
+
hbeam connect workserver
|
|
35
29
|
```
|
|
36
30
|
|
|
37
|
-
###
|
|
31
|
+
### One-time passphrase mode
|
|
38
32
|
|
|
39
|
-
|
|
33
|
+
Use `--temp` when you want a throwaway passphrase flow:
|
|
40
34
|
|
|
41
35
|
```bash
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
### Listen with a persistent identity
|
|
36
|
+
# Generate and announce a one-time passphrase
|
|
37
|
+
echo 'hello world' | hbeam --temp
|
|
46
38
|
|
|
47
|
-
|
|
39
|
+
# Reuse a known passphrase and announce on it
|
|
40
|
+
echo 'hello again' | hbeam <passphrase> --temp
|
|
48
41
|
|
|
49
|
-
|
|
50
|
-
hbeam
|
|
42
|
+
# Connect to an existing passphrase
|
|
43
|
+
hbeam <passphrase>
|
|
51
44
|
```
|
|
52
45
|
|
|
53
|
-
```
|
|
54
|
-
HBEAM ·····
|
|
55
|
-
PUBLIC KEY
|
|
56
|
-
a1b2c3d4e5f6...
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Share your public key once — peers can reconnect any time without a new passphrase.
|
|
60
|
-
|
|
61
46
|
### Address book
|
|
62
47
|
|
|
63
|
-
Save peers by name so you
|
|
48
|
+
Save peers by name so you do not have to remember public keys:
|
|
64
49
|
|
|
65
50
|
```bash
|
|
66
51
|
# Add a peer
|
|
@@ -99,6 +84,71 @@ hbeam whoami
|
|
|
99
84
|
a1b2c3d4e5f6...
|
|
100
85
|
```
|
|
101
86
|
|
|
87
|
+
### Expose - TCP over P2P
|
|
88
|
+
|
|
89
|
+
Expose a local TCP service to a remote peer:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Reverse proxy: expose localhost:3000 using your identity
|
|
93
|
+
hbeam expose 3000
|
|
94
|
+
|
|
95
|
+
# Reverse proxy: expose localhost:3000 with a one-time passphrase
|
|
96
|
+
hbeam expose 3000 --temp
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
HBEAM ···
|
|
101
|
+
|
|
102
|
+
ANNOUNCING
|
|
103
|
+
a1b2c3d4e5f6...
|
|
104
|
+
ONLINE [96.9.225.80:34725]
|
|
105
|
+
FORWARDING localhost:3000
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Access a remote peer's service locally:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Forward proxy: connect to a saved peer, listen on local port 8080
|
|
112
|
+
hbeam connect workserver -p 8080
|
|
113
|
+
|
|
114
|
+
# Forward proxy: connect by passphrase (one-time mode)
|
|
115
|
+
hbeam connect <passphrase> -p 8080 --temp
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
HBEAM ···
|
|
120
|
+
|
|
121
|
+
CONNECTING workserver
|
|
122
|
+
ONLINE [96.9.225.80:34725]
|
|
123
|
+
LISTENING 127.0.0.1:8080
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Any TCP traffic (HTTP, SSH, databases, etc.) can be tunneled. Both sides are end-to-end encrypted via Noise.
|
|
127
|
+
|
|
128
|
+
### Gateway - local HTTP router for peers
|
|
129
|
+
|
|
130
|
+
Run a local HTTP gateway that maps `{peer}.localhost` to remote peers over P2P:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Start gateway on port 9000
|
|
134
|
+
hbeam gateway -p 9000
|
|
135
|
+
|
|
136
|
+
# Browser or curl traffic routed to address-book peer "workserver"
|
|
137
|
+
open http://workserver.localhost:9000/
|
|
138
|
+
curl http://workserver.localhost:9000/health
|
|
139
|
+
|
|
140
|
+
# Route directly to a raw public key
|
|
141
|
+
curl http://a1b2c3d4e5f6...localhost:9000/
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
You can also run gateway in one-time mode:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
hbeam gateway -p 9000 --temp
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
The gateway resolves subdomains with the same target rules as `hbeam connect`: hex public key, address-book name, then passphrase.
|
|
151
|
+
|
|
102
152
|
### Serve a single file
|
|
103
153
|
|
|
104
154
|
Serve one file over an encrypted hbeam session:
|
|
@@ -107,10 +157,10 @@ Serve one file over an encrypted hbeam session:
|
|
|
107
157
|
hbeam serve ./report.pdf
|
|
108
158
|
```
|
|
109
159
|
|
|
110
|
-
This
|
|
160
|
+
This serves from your persistent identity by default. For one-time passphrase mode instead:
|
|
111
161
|
|
|
112
162
|
```bash
|
|
113
|
-
hbeam serve ./report.pdf --
|
|
163
|
+
hbeam serve ./report.pdf --temp
|
|
114
164
|
```
|
|
115
165
|
|
|
116
166
|
On the receiving side, connect normally (`hbeam <passphrase>` or `hbeam connect <name>`). hbeam detects the incoming file header and prompts where to save it. Use `-o` to skip the prompt:
|
|
@@ -129,23 +179,30 @@ hbeam <passphrase> > report.pdf
|
|
|
129
179
|
### Options
|
|
130
180
|
|
|
131
181
|
```
|
|
132
|
-
-
|
|
182
|
+
-t, --temp Use one-time passphrase mode
|
|
133
183
|
-o, --output Save incoming file to a specific path
|
|
184
|
+
-p, --port Local listen port (connect/gateway mode)
|
|
185
|
+
--host Target/listen host (expose/connect mode, default: localhost)
|
|
134
186
|
-h, --help Show help
|
|
135
187
|
-v, --version Show version
|
|
136
188
|
```
|
|
137
189
|
|
|
138
190
|
## How it works
|
|
139
191
|
|
|
192
|
+
Identity mode (default):
|
|
193
|
+
|
|
194
|
+
1. A persistent Noise keypair is loaded from `~/.config/hbeam/identity.json` (or created on first use).
|
|
195
|
+
2. A HyperDHT node announces (server) or connects (client) using that keypair.
|
|
196
|
+
3. The Noise protocol negotiates an encrypted session between the two peers.
|
|
197
|
+
4. Data flows through a `streamx` duplex stream - stdin/stdout on the CLI, or any readable/writable in code.
|
|
198
|
+
|
|
199
|
+
One-time mode (`--temp`):
|
|
200
|
+
|
|
140
201
|
1. A 32-byte random seed is generated and encoded as a base32 passphrase.
|
|
141
|
-
2. A Noise keypair is deterministically derived from
|
|
202
|
+
2. A Noise keypair is deterministically derived from that passphrase using `sodium-universal`.
|
|
142
203
|
3. An ephemeral HyperDHT node announces (server) or connects (client) using that keypair.
|
|
143
|
-
4. The Noise protocol negotiates an encrypted session between the two peers.
|
|
144
|
-
5. Data flows through a `streamx` duplex stream — stdin/stdout on the CLI, or any readable/writable in code.
|
|
145
|
-
|
|
146
|
-
When using identity mode (`--listen` without a passphrase, or `connect`), a persistent keypair is loaded from `~/.config/hbeam/identity.json` instead of deriving one from a passphrase. The connection is still end-to-end encrypted via Noise.
|
|
147
204
|
|
|
148
|
-
All traffic is end-to-end encrypted. The DHT is only used for peer discovery; it never sees
|
|
205
|
+
All traffic is end-to-end encrypted. The DHT is only used for peer discovery; it never sees plaintext.
|
|
149
206
|
|
|
150
207
|
## Requirements
|
|
151
208
|
|