claudelink-bridge 0.1.31 → 0.1.33
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/bin/cli.js +9 -9
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -174,16 +174,16 @@ async function checkPortRunning(port) {
|
|
|
174
174
|
return new Promise((resolve) => {
|
|
175
175
|
import('ws').then(({ default: WS }) => {
|
|
176
176
|
const ws = new WS(`ws://localhost:${port}`);
|
|
177
|
-
const t = setTimeout(() => { try { ws.terminate(); } catch {} resolve(false); },
|
|
178
|
-
|
|
179
|
-
ws.on('
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
177
|
+
const t = setTimeout(() => { try { ws.terminate(); } catch {} resolve(false); }, 1000);
|
|
178
|
+
// Connection opened = our bridge is listening (it closes non-extension origins but still accepts the TCP handshake)
|
|
179
|
+
ws.on('open', () => { clearTimeout(t); ws.terminate(); resolve(true); });
|
|
180
|
+
// Server actively closed = also our bridge (it accepted then rejected)
|
|
181
|
+
ws.on('close', () => { clearTimeout(t); resolve(true); });
|
|
182
|
+
// Connection refused = nothing on this port
|
|
183
|
+
ws.on('error', (err) => {
|
|
184
|
+
clearTimeout(t);
|
|
185
|
+
resolve(err.code !== 'ECONNREFUSED');
|
|
185
186
|
});
|
|
186
|
-
ws.on('error', () => { clearTimeout(t); resolve(false); });
|
|
187
187
|
}).catch(() => resolve(false));
|
|
188
188
|
});
|
|
189
189
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudelink-bridge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"description": "Bridge your browser to Claude Code CLI. The local server for the ClaudeLink Chrome extension — send screenshots, page content, and custom commands from any webpage directly to Claude Code.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|