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 CHANGED
@@ -133,10 +133,15 @@ before it runs — for real deployments, host the client page yourself.
133
133
 
134
134
  ## Credits
135
135
 
136
- The approach came from [alma-relay](https://github.com/yetone/alma-relay):
137
- an outbound-only agent connection, a relay blind to its traffic, and a Workers
138
- deployment that costs nothing while idle. Bolthole generalizes it into a
139
- protocol and SDK for any service.
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.0",
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": ["src"],
30
- "engines": { "node": ">=22" },
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: '0.1.0', caps: ['mux/1'] }));
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 const VERSION = '0.1.0';
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
@@ -0,0 +1,2 @@
1
+ // Package version, in one place so every module agrees.
2
+ export const VERSION = '0.1.1';