Your phone is the terminal. Stream a Linux/Mac desktop to an iPhone over WebRTC through NAT, with audio and input. Open source, single binaries.

0 downloads

Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/network-computer.git
HTTPS
https://gitstable.com/git/askrobots/network-computer.git
SSH
ssh://git@gitstable.com:2222/askrobots/network-computer.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

Dan Quellhorst Firefox policy: no WebRTC mDNS (a page using WebRTC made Firefox listen on UDP 5353) a1d92f3 1 month, 3 weeks ago History
sites_test.go · 1.6 KB · 53 lines
1package main
2
3import (
4 "io"
5 "net/http"
6 "net/http/httptest"
7 "testing"
8)
9
10func TestSitesProxy(t *testing.T) {
11 var sawCookie, sawAuth string
12 obj := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
13 sawCookie, sawAuth = r.Header.Get("Cookie"), r.Header.Get("Authorization")
14 if r.URL.Path == "/s/site" {
15 http.Redirect(w, r, "http://"+r.Host+"/s/site/index", http.StatusFound)
16 return
17 }
18 w.Header().Set("Set-Cookie", "os=1")
19 io.WriteString(w, "page "+r.URL.Path)
20 }))
21 defer obj.Close()
22 h, err := sitesProxy(obj.URL)
23 if err != nil {
24 t.Fatal(err)
25 }
26 get := func(method, path string) *httptest.ResponseRecorder {
27 r := httptest.NewRequest(method, path, nil)
28 r.Header.Set("Cookie", "nc_session=secret")
29 r.Header.Set("Authorization", "Bearer x")
30 w := httptest.NewRecorder()
31 h.ServeHTTP(w, r)
32 return w
33 }
34 w := get("GET", "/s/site/index")
35 if w.Code != 200 || w.Body.String() != "page /s/site/index" {
36 t.Fatalf("page: %d %q", w.Code, w.Body.String())
37 }
38 if sawCookie != "" || sawAuth != "" {
39 t.Fatalf("credentials passed on: cookie %q auth %q", sawCookie, sawAuth)
40 }
41 if w.Header().Get("Set-Cookie") != "" {
42 t.Fatal("the object server's cookie reached the visitor")
43 }
44 if w := get("GET", "/s/site"); w.Header().Get("Location") != "/s/site/index" {
45 t.Fatalf("redirect: %q", w.Header().Get("Location"))
46 }
47 if w := get("POST", "/s/site/index"); w.Code != http.StatusMethodNotAllowed {
48 t.Fatalf("POST: %d", w.Code)
49 }
50 if w := get("GET", "/api/records"); w.Code != http.StatusNotFound {
51 t.Fatalf("outside /s/: %d", w.Code)
52 }
53}