cmd/tsconnect: make PeerAPI work

JS -> native nodes worked already, tested by exposing a fetch() method
to JS (it's Promise-based to be consistent with the native fetch() API).

Native nodes -> JS almost worked, we just needed to set the LocalBackend
on the userspace netstack.

Fixes #5130

Signed-off-by: Mihai Parparita <mihai@tailscale.com>
This commit is contained in:
Mihai Parparita
2022-08-02 16:47:43 -07:00
committed by Mihai Parparita
parent 5f6abcfa6f
commit adc5ffea99
2 changed files with 69 additions and 0 deletions

View File

@ -26,6 +26,13 @@ declare global {
onDone: () => void
}
): IPNSSHSession
fetch(
url: string
): Promise<{
status: number
statusText: string
text: () => Promise<string>
}>
}
interface IPNSSHSession {