You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e9d4cb2
Browse filesBrowse the repository at this point in the historyBrowse files
feat(remote): host and reverse port forwards through a server listener (Refs 1lck/Lithe-IDEA#2231)
The server can now listen on a host port for a forwarding rule the user
added (listener.open/adopt/close/list, listener.accepted, feature
"listener"). Host rules relay every accepted connection on the host;
reverse rules hand each connection to the client as a tunnel that reaches
this machine's loopback interface.
Core adds remote.startHostForward and remote.startReverseForward. Host
forwards listen on the host's loopback interface unless the request asks
for every interface; reverse forwards bind loopback only and start only
when the new remote preference allowReverseForwarding is on (off by
default). All kinds share the 64-forward limit, report kind and
failedConnections, and are never reopened after a reconnect. New error
codes: forward_host_port_in_use, forward_host_port_denied,
forward_host_unsupported, reverse_forward_disabled.
Copy file name to clipboardExpand all lines: rust/contracts/remote-workspace-protocol-v1.md
+41-5Lines changed: 41 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,8 +49,10 @@ Other clients should do the same.
49
49
bytes of UTF-8 JSON. Frames larger than 16 MiB are rejected.
50
50
3. Closing the client-to-server stream is a disconnect.
51
51
52
-
The server never listens on a network port; all traffic, including tunnels,
53
-
uses this stream. Local port forwards are the client's: the reference client
52
+
All traffic, including tunnels, uses this stream. The server listens on a
53
+
network port only for a forwarding rule the user added (`listener.open`, see
54
+
"Listeners"); such a port belongs to the connection that opened it and
55
+
closes with it. Local port forwards are the client's: the reference client
54
56
listens on loopback addresses only, because a remote development server
55
57
usually has no authentication of its own, and bridges at most 64 connections
56
58
per forward, leaving further ones in the system's listen queue until one
@@ -154,6 +156,10 @@ subscribe before creating the resource.
154
156
|`tunnel.write`|`tunnelId`, `data`|`null`; `BUSY` when the peer stops reading |
155
157
|`tunnel.shutdownWrite`|`tunnelId`|`null`; queued data is sent, then the write side is shut down; replies keep arriving |
156
158
|`tunnel.close`|`tunnelId`|`null`; aborts both directions, queued data is discarded |
159
+
|`listener.open`|`listenerId`, `host` (an IP address), `port` (`0`: the host chooses), `relay?` (a `tunnel.open` target) |`port`; `ADDRESS_IN_USE` when another socket holds the port, `PERMISSION_DENIED` when the host refuses it, `BUSY` while the session has 64 listeners |
160
+
|`listener.adopt`|`listenerId`, `acceptId`, `tunnelId`|`null`; the waiting connection becomes that tunnel; `UNKNOWN_RESOURCE` when it no longer waits |
161
+
|`listener.close`|`listenerId`|`listenerId`, `port`, `connections`, `failedConnections`; closes the port and every connection it relays or still holds |
162
+
|`listener.list`| — |`listeners` by `listenerId`: `listenerId`, `port`, `connections`, `failedConnections`|
157
163
|`ports.listening`| — |`ports` sorted by `address` and `port`, one entry for each: `address`, `port`, and `pid` and `process` (the command name) when the server's user can inspect the owning process |
158
164
159
165
`fs.copy` refuses, with `INVALID_REQUEST`, to copy a file onto itself —
@@ -257,10 +263,40 @@ environment and caches it for the session. `process.spawn` with
Copy file name to clipboardExpand all lines: rust/contracts/rust-core-api.md
+75-23Lines changed: 75 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -818,7 +818,9 @@ or removing a command fails until the table changes in the same commit.
818
818
| `remote.workspaceTrust` | Read remote workspace trust decisions and one open workspace's trust |
819
819
| `remote.editWorkspaceTrust` | Record or remove one remote workspace trust decision |
820
820
| `remote.startForward` | Forward a local port to a port as the remote host sees it |
821
-
| `remote.stopForward` | Stop one port forward and close its local port |
821
+
| `remote.startHostForward` | Make the remote host listen on a port and connect it to another server |
822
+
| `remote.startReverseForward` | Make the remote host listen on a loopback port that reaches a port on this machine |
823
+
| `remote.stopForward` | Stop one port forward and close the port it listens on |
822
824
| `remote.forwards` | List the running port forwards of one connection |
823
825
| `remote.parseForwardAddress` | Read a port, `host:port` or URL typed into the ports page into a forward target |
824
826
| `remote.connections` | Read the SSH connections the user saved |
@@ -829,7 +831,7 @@ or removing a command fails until the table changes in the same commit.
829
831
| `remote.mottyHosts` | List the SSH hosts saved in Motty for an import |
830
832
| `remote.listWslDistributions` | List the WSL distributions installed on this Windows machine |
831
833
| `remote.preferences` | Read the remote workspace settings and what each automatic value resolves to |
832
-
| `remote.editPreferences` | Set the SSH program or the reconnect limit, or make one automatic again |
834
+
| `remote.editPreferences` | Set the SSH program, the reconnect limit or whether reverse forwards are allowed, or make one automatic again |
833
835
| `git.historyRewritePreview` | Review undo, message edit, squash, or drop with complete messages, eligibility, and an immutable checkout expectation |
0 commit comments