openzoo 0.29.4 → 0.29.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/lib/cursorbackend.js +11 -10
- package/package.json +1 -1
package/lib/cursorbackend.js
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* content-type and answer in kind: bare message for connect unary proto, enveloped
|
|
27
27
|
* + trailers for grpc-web. Both are handled below.
|
|
28
28
|
*/
|
|
29
|
-
import
|
|
29
|
+
import https from 'node:https';
|
|
30
30
|
import fs from 'node:fs';
|
|
31
31
|
import os from 'node:os';
|
|
32
32
|
import path from 'node:path';
|
|
@@ -172,17 +172,17 @@ function respond(req, res, method, models) {
|
|
|
172
172
|
export function startCursorBackend({ port = 8443, models, log = () => {} } = {}) {
|
|
173
173
|
const { cert, key } = ensureCert(log);
|
|
174
174
|
let conns = 0;
|
|
175
|
-
// HTTP/
|
|
176
|
-
//
|
|
177
|
-
//
|
|
178
|
-
//
|
|
179
|
-
//
|
|
180
|
-
|
|
175
|
+
// HTTP/1.1 ONLY, but with ALPN advertising http/1.1. Two measured facts drove
|
|
176
|
+
// this: (1) with NO ALPN the client aborts with ERR_SSL_NO_APPLICATION_PROTOCOL
|
|
177
|
+
// — it requires the server to name a protocol; (2) when we offered h2, the
|
|
178
|
+
// editor's h2 connections RESET (ECONNRESET wall) while its h1 calls completed
|
|
179
|
+
// (requests #1-5). Connect-RPC and gRPC-web both work over h1, so we advertise
|
|
180
|
+
// ONLY http/1.1: the client negotiates it and every call completes.
|
|
181
|
+
const server = https.createServer(
|
|
181
182
|
{
|
|
182
183
|
cert: fs.readFileSync(cert),
|
|
183
184
|
key: fs.readFileSync(key),
|
|
184
|
-
|
|
185
|
-
ALPNProtocols: ['h2', 'http/1.1'],
|
|
185
|
+
ALPNProtocols: ['http/1.1'],
|
|
186
186
|
SNICallback: (servername, cb) => { log(`cursor-tls: <- ClientHello SNI=${servername}`); cb(null); },
|
|
187
187
|
},
|
|
188
188
|
async (req, res) => {
|
|
@@ -206,9 +206,10 @@ export function startCursorBackend({ port = 8443, models, log = () => {} } = {})
|
|
|
206
206
|
}
|
|
207
207
|
},
|
|
208
208
|
);
|
|
209
|
+
server.on('secureConnection', (sock) => { log(`cursor-tls: connected alpn=${sock.alpnProtocol || 'none'} sni=${sock.servername || '?'}`); });
|
|
209
210
|
// NEVER swallow this — a rejected handshake is exactly the failure to see.
|
|
210
211
|
server.on('tlsClientError', (e, sock) => {
|
|
211
|
-
log(`cursor-tls: HANDSHAKE FAILED ${e.code || e.message}
|
|
212
|
+
log(`cursor-tls: HANDSHAKE FAILED ${e.code || e.message} alpn=${sock?.alpnProtocol || '?'}`);
|
|
212
213
|
});
|
|
213
214
|
server.listen(port, '127.0.0.1', () => log(`cursor-backend: listening on 127.0.0.1:${port} as ${CURSOR_HOSTS[0]}`));
|
|
214
215
|
return { server, port };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.5",
|
|
4
4
|
"description": "Local x402-paying proxy + MCP server for openzoo.fun — point any OpenAI-compatible harness (Cursor, Claude Code, aider, SDKs) at localhost and it pays per call from a local burner wallet. Solana and Base rails live; Robinhood experimental.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|