@hahahhh/sshx 0.0.2 → 0.0.3-rc.0

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.
Files changed (2) hide show
  1. package/README.md +13 -22
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  - 🔄 **Reverse command bridge** — run `sshx local <cmd>` *on the remote* to execute commands on your local machine, with stdout, stderr, exit code, and stdin all propagated.
8
8
  - 🔌 **Automatic port forwarding** — remote loopback listeners (e.g., a dev server on `localhost:8080`) are automatically detected and forwarded to your local machine.
9
9
  - 🌐 **Local domain binding** — access forwarded ports as `<host>.<your-user>.sshx:<port>` in your local browser, no manual `-L` flags needed.
10
- - 🐳 **Docker container support** — target running containers by name or ID: `sshx my-container`. The same bridge, port forwarding, and domain features work inside containers via `docker exec`.
10
+ - 🐳 **Docker container support** — target running containers by name or ID: `sshx my-container`. Command bridge support works inside containers via `docker exec`.
11
11
 
12
12
  ## Why sshx?
13
13
 
@@ -39,7 +39,7 @@ When the target doesn't match any SSH host, sshx falls back to resolving it as a
39
39
  - `sshx <container-name>` — opens a shell in the container via `docker exec`.
40
40
  - `sshx <container-id-prefix>` — matches by container ID prefix.
41
41
  - Explicit SSH targets (`user@host`, IP addresses, hostnames with dots/colons) are never treated as Docker containers.
42
- - The full sshx feature set (command bridge, port detection, domain binding) works inside containers.
42
+ - Command bridge support works inside containers.
43
43
  - Requires `docker` CLI available on the local machine — gracefully falls back to SSH if Docker isn't found or the container isn't running.
44
44
 
45
45
  ### 🔄 Remote-to-Local Command Bridge
@@ -62,15 +62,15 @@ sshx local pbcopy < /tmp/some-data
62
62
  When a process on the remote starts listening on `127.0.0.1` (e.g., `npm run dev` on port 3000), sshx detects it and:
63
63
 
64
64
  1. Broadcasts the port to the local daemon.
65
- 2. Creates a shared TCP forward over SSH.
66
- 3. Binds the SSH target domain, e.g. `debian.<your-user>.sshx`.
65
+ 2. Assigns the SSH target its own loopback IP.
66
+ 3. Exposes a TCP proxy at the target domain, e.g. `debian.<your-user>.sshx:3000`.
67
67
 
68
- sshx first tries to use the same local port as the remote listener. If that local port is already occupied, it automatically tries the next port (`+1`) until it finds a free one. Run `sshx forward` to see the active mapping.
68
+ The URL port is the remote port. sshx does not bind `127.0.0.1:<port>`; it binds the target's private loopback IP instead, so `debian.<your-user>.sshx:8080` and `ubuntu.<your-user>.sshx:8080` can point at different hosts at the same time. Run `sshx forward` to see the active mappings.
69
69
 
70
70
  ### 🌐 Local Domains (macOS, Linux)
71
71
 
72
- - A local DNS responder on `127.0.0.1:53` resolves `*.sshx` names dynamically.
73
- - The domain resolves to localhost; the URL port selects the forwarded local listener.
72
+ - A local DNS responder on `127.0.0.1:53` resolves active target names dynamically.
73
+ - Each target domain resolves to a private loopback IP; the URL port selects the remote listener.
74
74
  - On macOS, `/etc/resolver/<suffix>` is configured once (with `sudo` when needed).
75
75
  - All terminals on the same host share one DNS resolver and forwarding daemon.
76
76
 
@@ -177,13 +177,12 @@ On your **local** machine, open:
177
177
  http://my-server.<your-user>.sshx:8080
178
178
  ```
179
179
 
180
- No `-L` flags, no manual forwarding.
181
-
182
- If local port `8080` is already occupied, sshx will try `8081`, then `8082`, and so on. Check the chosen port with:
180
+ No `-L` flags, no manual forwarding. Since each target gets its own loopback IP, another target can expose its own `8080` at the same time:
183
181
 
184
182
  ```sh
185
183
  sshx forward
186
- # 8080 -> my-server:8080
184
+ # http://my-server.<your-user>.sshx:8080 -> my-server:8080
185
+ # http://other-server.<your-user>.sshx:8080 -> other-server:8080
187
186
  ```
188
187
 
189
188
  ---
@@ -201,17 +200,9 @@ features:
201
200
  # Remote-to-local command bridge (`sshx local <cmd>` on the remote)
202
201
  commandBridge: true
203
202
 
204
- ports:
205
- # Auto-detect loopback TCP listeners on the remote and forward them.
206
- auto: true
207
- # Future: also detect 0.0.0.0 listeners.
208
- # bindAll: false
209
-
210
- domains:
211
- # Enable local domain binding (<host>.<user>.sshx:<port>).
212
- enabled: true
213
- # Custom domain suffix. Default: <local-user>.sshx
214
- suffix: user.sshx
203
+ # Auto-detect remote loopback TCP listeners and expose them via
204
+ # <host>.<user>.sshx:<remote-port>.
205
+ autoForward: true
215
206
 
216
207
  commands:
217
208
  # Commands blocked from bridge execution.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hahahhh/sshx",
3
- "version": "0.0.2",
3
+ "version": "0.0.3-rc.0",
4
4
  "type": "module",
5
5
  "description": "Transparent SSH enhancement wrapper for OpenSSH",
6
6
  "repository": {