iPhone client for network-computer: see and drive a remote Linux/Mac desktop over WebRTC, phone as trackpad and keyboard, desktop on a TV via AirPlay.

0 downloads

Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/network-computer-ios.git
HTTPS
https://gitstable.com/git/askrobots/network-computer-ios.git
SSH
ssh://git@gitstable.com:2222/askrobots/network-computer-ios.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 First cut of the iPhone client cc1f67f 2 months ago History
Messages.swift · 1.1 KB · 42 lines
1import Foundation
2
3/// Mirrors internal/proto/proto.go in the Go repo.
4struct SignalMessage: Codable {
5 var type: String
6 var name: String?
7 var to: String?
8 var from: String?
9 var sdp: String?
10 var pin: String?
11 var candidate: IceCandidateJSON?
12 var hosts: [String]?
13 var error: String?
14}
15
16/// RTCIceCandidateInit as the browser and Pion serialise it.
17struct IceCandidateJSON: Codable {
18 var candidate: String
19 var sdpMid: String?
20 var sdpMLineIndex: Int32?
21}
22
23struct ICEServerJSON: Codable {
24 var urls: [String]
25 var username: String?
26 var credential: String?
27}
28
29struct RendezvousConfig: Codable {
30 var iceServers: [ICEServerJSON]
31}
32
33/// One message on the "input" data channel. Same JSON as the browser client sends.
34struct InputEvent: Codable {
35 var t: String // mm, mr, md, mu, wh, kd, ku
36 var x: Double? = nil // mm: absolute 0..1
37 var y: Double? = nil
38 var dx: Double? = nil // mr: relative pixels; wh: scroll pixels
39 var dy: Double? = nil
40 var b: Int? = nil // 0 left, 1 middle, 2 right
41 var code: String? = nil // KeyboardEvent.code, e.g. "KeyA"
42}