@gricha/perry 0.1.1 → 0.1.2

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.
@@ -1,5 +1,6 @@
1
1
  import WebSocket from 'ws';
2
2
  import { spawn } from 'child_process';
3
+ import { DEFAULT_AGENT_PORT } from '../shared/constants';
3
4
  export function isLocalWorker(worker) {
4
5
  const host = worker
5
6
  .replace(/^https?:\/\//, '')
@@ -125,6 +126,9 @@ export function getTerminalWSUrl(worker, workspaceName) {
125
126
  base = `http://${base}`;
126
127
  }
127
128
  const wsProtocol = base.startsWith('https://') ? 'wss://' : 'ws://';
128
- const host = base.replace(/^https?:\/\//, '');
129
+ let host = base.replace(/^https?:\/\//, '');
130
+ if (!host.includes(':')) {
131
+ host = `${host}:${DEFAULT_AGENT_PORT}`;
132
+ }
129
133
  return `${wsProtocol}${host}/rpc/terminal/${encodeURIComponent(workspaceName)}`;
130
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gricha/perry",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Self-contained CLI for spinning up Docker-in-Docker development environments with SSH and proxy helpers.",
5
5
  "type": "module",
6
6
  "bin": {