bolthole 0.1.0 → 0.1.1
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 +9 -4
- package/package.json +7 -3
- package/src/agent.js +2 -1
- package/src/relay.js +2 -1
- package/src/version.js +2 -0
package/README.md
CHANGED
|
@@ -133,10 +133,15 @@ before it runs — for real deployments, host the client page yourself.
|
|
|
133
133
|
|
|
134
134
|
## Credits
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
<img src="https://alma.now/assets/alma.png" width="44" height="44" alt="Alma" align="left" hspace="12">
|
|
137
|
+
|
|
138
|
+
The approach came from [alma-relay](https://github.com/yetone/alma-relay), the
|
|
139
|
+
self-hosted relay for [Alma](https://alma.now) Remote Access: an outbound-only
|
|
140
|
+
agent connection, a relay that only sees ciphertext, and a Cloudflare Workers
|
|
141
|
+
deployment that costs nothing while idle. Thanks to
|
|
142
|
+
[@yetone](https://github.com/yetone) and its contributors.
|
|
143
|
+
|
|
144
|
+
<br clear="left">
|
|
140
145
|
|
|
141
146
|
## License
|
|
142
147
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bolthole",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Reach any service from anywhere through a relay that can't read your traffic. Browser, Node, Deno, Bun and Workers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,8 +26,12 @@
|
|
|
26
26
|
".": "./src/index.js",
|
|
27
27
|
"./relay": "./src/relay.js"
|
|
28
28
|
},
|
|
29
|
-
"files": [
|
|
30
|
-
|
|
29
|
+
"files": [
|
|
30
|
+
"src"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=22"
|
|
34
|
+
},
|
|
31
35
|
"scripts": {
|
|
32
36
|
"test": "node --test test/*.test.js"
|
|
33
37
|
},
|
package/src/agent.js
CHANGED
|
@@ -6,6 +6,7 @@ import { agentHandshake, PROTO_MUX, MAX_RECORD } from './noise.js';
|
|
|
6
6
|
import { Session } from './mux.js';
|
|
7
7
|
import { wsConn, serveHttp, WsStream } from './kinds.js';
|
|
8
8
|
import { enc, dec } from './bytes.js';
|
|
9
|
+
import { VERSION } from './version.js';
|
|
9
10
|
|
|
10
11
|
const E2E_PATH = '/.bolthole/e2e';
|
|
11
12
|
|
|
@@ -87,7 +88,7 @@ export class Agent {
|
|
|
87
88
|
const { tokenHash } = await this.keys;
|
|
88
89
|
const base = this.opts.relay.replace(/^http/, 'ws').replace(/\/+$/, '');
|
|
89
90
|
const conn = await wsConn(new this.WS(`${base}/v1/agent?th=${tokenHash}`, ['relay.v1']));
|
|
90
|
-
await conn.write(JSON.stringify({ type: 'hello', v: 1, token_hash: tokenHash, name: this.opts.name, auth: this.opts.auth, version:
|
|
91
|
+
await conn.write(JSON.stringify({ type: 'hello', v: 1, token_hash: tokenHash, name: this.opts.name, auth: this.opts.auth, version: VERSION, caps: ['mux/1'] }));
|
|
91
92
|
let w;
|
|
92
93
|
try {
|
|
93
94
|
w = JSON.parse(dec.decode(await conn.read()));
|
package/src/relay.js
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
import { Session, ResetError } from './mux.js';
|
|
8
8
|
import { WsStream, encodeHeaders, decodeHeaders } from './kinds.js';
|
|
9
9
|
import { enc, dec, unb64url, deferred } from './bytes.js';
|
|
10
|
+
import { VERSION } from './version.js';
|
|
10
11
|
|
|
11
|
-
export
|
|
12
|
+
export { VERSION };
|
|
12
13
|
const TOKEN_RE = /^[A-Za-z0-9_-]{16,128}$/;
|
|
13
14
|
const HASH_RE = /^[0-9a-f]{64}$/;
|
|
14
15
|
|
package/src/version.js
ADDED