Compare commits

...
5 Commits
Author SHA1 Message Date
VallierDevandClaude Opus 5.5 482c01a85d viewer tests: accept the video track RPC in the loopback session
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 20:45:43 +08:00
VallierDevandClaude Opus 5.5 7f6cf6e092 Release v0.2.39
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 20:39:58 +08:00
VallierDevandClaude Opus 5.5 c0c04a2c98 viewer: request the desktop video track like the official viewer (#124)
The official iPhone viewer sends RpcRequest case 15 SendVideoTrackReq (no
fields) right after CONTROL opens. Without it a second session only joins the
stream already encoded for another viewer: no SPS/PPS/IDR, so it stays black.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 20:37:43 +08:00
VallierDevandClaude Opus 5.5 b636f1b278 Release v0.2.38
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 20:22:03 +08:00
VallierDevandClaude Opus 5.5 64d2ffbdd3 ICE: trust the system certificate store for TURN over TLS
A TLS-inspecting HTTP proxy re-signs the TURN certificate with a CA that the
host's administrator installed in the system store; OpenSSL accepts it while
the bundled Mozilla roots alone fail with UnknownIssuer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 20:21:37 +08:00
11 changed files with 60 additions and 3 deletions

No files matched your search

Generated
+2 -1
View File
@@ -2741,7 +2741,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "uu-remote-linux"
version = "0.2.37"
version = "0.2.39"
dependencies = [
"async-trait",
"base64 0.22.1",
@@ -3016,6 +3016,7 @@ dependencies = [
"crc",
"log",
"rand 0.8.8",
"rustls-native-certs",
"serde",
"serde_json",
"stun",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "uu-remote-linux"
version = "0.2.37"
version = "0.2.39"
edition = "2021"
default-run = "uuremote-server"
authors = ["uu-remote-linux contributors"]
+13
View File
@@ -0,0 +1,13 @@
TURN over TLS 改为同时信任系统证书库。/ TURN over TLS now also trusts the system certificate store.
### 修复 / Fixed
- **TURN over TLS 报 UnknownIssuer**:v0.2.37 的 TCP/TLS 中继只信任内置的 Mozilla 根证书;在会检查 TLS 的 HTTP 代理后面,中继证书由主机管理员装在系统证书库里的 CA 重新签发,OpenSSL 能通过、我们却报 `UnknownIssuer`。现在同时信任系统证书库(与 OpenSSL 一致)和内置根证书。仅影响 `UU_USE_PROXY=1` 时的 TCP/TLS 中继。
TCP/TLS relays (only with `UU_USE_PROXY=1`) now trust the system certificate store as well as the bundled Mozilla roots, so CAs added for TLS-inspecting proxies are honoured.
### 验证范围 / Validation
单元测试与 CI;报告环境实机验证进行中。
### 下载 / Download
`uu-remote-linux_0.2.38_<amd64|arm64>.deb`,或 `uu-remote-linux-v0.2.38-<x86_64|aarch64>-linux.tar.gz`(解压后运行 `./install.sh`),或 `docker pull ghcr.io/vallierdev/uu-remote-linux:v0.2.38`(x86_64)。
**非官方项目,与网易无关。** / **Unofficial, not affiliated with NetEase.**
+13
View File
@@ -0,0 +1,13 @@
Linux 控制端像官方控制端一样请求桌面视频轨道,修复第二个会话永久黑屏。/ The Linux viewer now requests the desktop video track like the official viewer, fixing a permanently black second session.
### 修复 / Fixed
- **第二个会话黑屏(#124,感谢 @shao-zhijie 的码流取证)**:被控端已在给别的控制端推流时,Linux 控制端只会接上那条流的中段,没有 SPS/PPS/IDR,永远无法解码;官方主机也不响应 RTCP PLI。官方 iPhone 控制端在 CONTROL 通道打开后会立即发 RPC 15 `SendVideoTrackReq`(无字段);Linux 控制端现在桌面会话里也发这一条。
Desktop sessions now send RpcRequest case 15 `SendVideoTrackReq` (no fields) right after CONTROL opens, as the official iPhone viewer does, so the host starts a track for this session instead of the viewer joining another session's stream mid-GOP.
### 验证范围 / Validation
单元测试与 CI;官方 iPhone 控制端发送该 RPC 的行为来自本项目主机日志(`response_field=11 value=None`)。与官方 macOS 主机的第二会话场景尚待报告者实测。
### 下载 / Download
`uu-remote-linux_0.2.39_<amd64|arm64>.deb`,或 `uu-remote-linux-v0.2.39-<x86_64|aarch64>-linux.tar.gz`(解压后运行 `./install.sh`),或 `docker pull ghcr.io/vallierdev/uu-remote-linux:v0.2.39`(x86_64)。
**非官方项目,与网易无关。** / **Unofficial, not affiliated with NetEase.**
+2
View File
@@ -172,10 +172,12 @@ impl Peer {
if index==0 {
let weak=Arc::downgrade(&channel);let state=observed.clone();
let chroma444=shape.capture_type==1 && std::env::var("UU_VIEWER_CHROMA").is_ok_and(|v|v=="444");
let desktop_track=shape.capture_type==1;
channel.on_open(Box::new(move ||Box::pin(async move {
state.control_open.store(true,Ordering::Release);
if let Some(channel)=weak.upgrade(){
let _=channel.send(&bytes::Bytes::from(wire::echo_request_with_clipboard(1,clipboard_enabled))).await;
if desktop_track {let _=channel.send(&bytes::Bytes::from(wire::request_video_track())).await;}
if chroma444 {let _=channel.send(&bytes::Bytes::from(wire::request_chroma444())).await;}
}
})));
+2
View File
@@ -82,6 +82,8 @@ async fn complete_session_uses_loopback_signaling_and_virtual_rtc_through_echo()
for (action,number) in [(super::power::Action::Reboot,9),(super::power::Action::Shutdown,12)] {
if message.data.as_ref()==action.message(2).as_slice(){input_tx.send(json!({"power":number})).await.unwrap();return}
}
// Desktop sessions also request the video track (RPC 15), like the official viewer.
if message.data.as_ref()==wire::request_video_track().as_slice() {return}
assert_eq!(&message.data[..],&wire::echo_request(1));
let mut action=Vec::new();wire::int(1,1,&mut action);wire::bytes(2,br#"{"seq":1}"#,&mut action);
if let Some(channel)=weak.upgrade(){channel.send(&bytes::Bytes::from(wire::envelope(100,3,&action))).await.unwrap();}
+17
View File
@@ -198,6 +198,14 @@ mod tests {
}
}
/// RpcRequest case 15 SendVideoTrackReq with no fields (track 0), sent by the official iPhone
/// viewer right after CONTROL opens (host logs: response_field=11 value=None). Without it a
/// second session only joins the stream already encoded for another viewer: no SPS/PPS/IDR (#124).
pub fn request_video_track()->Vec<u8>{
let mut header=Vec::new();int(1,2_000_001,&mut header);
let mut rpc=Vec::new();bytes(1,&header,&mut rpc);bytes(15,&[],&mut rpc);
envelope(2_000_001,21,&rpc)
}
/// CaptureSettingRequest field 7 = ChromaFormat 3, wrapped in RPC 21/case 2.
pub fn request_chroma444()->Vec<u8>{
let mut header=Vec::new();int(1,2_000_000,&mut header);
@@ -237,6 +245,15 @@ pub fn media_control(data:&[u8])->(Option<u32>,Option<u32>){
assert!(s.video_preferences(force).connect_options("synthetic-device",false).unwrap()==options);
}
}
#[test] fn video_track_request_is_an_empty_rpc_15(){
let message=request_video_track();
let fields=decode_wire(&message).unwrap();
assert!(fields.iter().any(|f|f.number==1));
let rpc=fields.iter().find_map(|f|match (f.number,&f.value){(21,WireValue::Bytes(b))=>Some(*b),_=>None}).unwrap();
let rpc=decode_wire(rpc).unwrap();
assert!(rpc.iter().any(|f|f.number==1));
assert!(rpc.iter().any(|f|matches!((f.number,&f.value),(15,WireValue::Bytes(b)) if b.is_empty())));
}
#[test] fn chroma_request_and_actual_sync_are_independent_of_encoder_list(){
let request=request_chroma444();let rpc=super::super::tools::blob(&request,21).unwrap();
let setting=super::super::tools::blob(rpc,2).unwrap();assert_eq!(super::super::tools::uint(setting,7),3);
+1 -1
View File
@@ -14,7 +14,7 @@ use viewer::clipboard;
#[cfg(test)] #[path="initialization.rs"] mod initialization;
use viewer::{api::Api,rtc::ReadyPolicy,session::{Options,Session},wire::Shape};
use std::time::Duration;
const HELP:&str="Experimental native viewer.\n uuremote-viewer ui (GTK window: sign-in, devices, sessions) Desktop UI requires viewer-sdl (decodes with the ffmpeg CLI, or FFmpeg 6.x libraries with viewer-ffmpeg).\n uuremote-viewer power DEVICE reboot|shutdown\n uuremote-viewer type DEVICE [options] (secret from UU_INPUT_ENV or stdin; reuses running viewer)\n options: --delay-ms MS --omit-last N --snapshot PATH --dry-run --new-session\n uuremote-viewer unbind DEVICE [--shared] (从账号删除设备 / remove a device from the account)\n uuremote-viewer terminal DEVICE [SESSION]\n uuremote-viewer files DEVICE ls PATH | get REMOTE LOCAL | put LOCAL REMOTE\n uuremote-viewer portmap DEVICE LOCAL_PORT HOST PORT\n uuremote-viewer files-ui|portmap-ui|terminal-ui DEVICE NAME (GTK tool windows)\n uuremote-viewer login [--no-gui]\n uuremote-viewer devices METHOD ARRAY_POINTER ID_POINTER NAME_POINTER\n uuremote-viewer assist CONNECT_ID (验证码从 stdin 读取一行)\n uuremote-viewer connect DEVICE true|false SHAPE_JSON echo|manual raw|legacy [--view-only]\nVideo: UU_VIEWER_CODEC=h264 forces H.264; UU_VIEWER_CHROMA=444 requests true color (default 4:2:0).\nAudio: UU_VIEWER_AUDIO=0 disables playback. UU_VIEWER_VIEW_ONLY=1 disables desktop input.\nDevice-list method/JSON pointers and compatibility shape require verified operator configuration.\nQR login reuses the sibling uuremote-server login command. Never run login in a captured log.\nEcho readiness is transport observation only; no sendVideoTrack RPC is emitted.";
const HELP:&str="Experimental native viewer.\n uuremote-viewer ui (GTK window: sign-in, devices, sessions) Desktop UI requires viewer-sdl (decodes with the ffmpeg CLI, or FFmpeg 6.x libraries with viewer-ffmpeg).\n uuremote-viewer power DEVICE reboot|shutdown\n uuremote-viewer type DEVICE [options] (secret from UU_INPUT_ENV or stdin; reuses running viewer)\n options: --delay-ms MS --omit-last N --snapshot PATH --dry-run --new-session\n uuremote-viewer unbind DEVICE [--shared] (从账号删除设备 / remove a device from the account)\n uuremote-viewer terminal DEVICE [SESSION]\n uuremote-viewer files DEVICE ls PATH | get REMOTE LOCAL | put LOCAL REMOTE\n uuremote-viewer portmap DEVICE LOCAL_PORT HOST PORT\n uuremote-viewer files-ui|portmap-ui|terminal-ui DEVICE NAME (GTK tool windows)\n uuremote-viewer login [--no-gui]\n uuremote-viewer devices METHOD ARRAY_POINTER ID_POINTER NAME_POINTER\n uuremote-viewer assist CONNECT_ID (验证码从 stdin 读取一行)\n uuremote-viewer connect DEVICE true|false SHAPE_JSON echo|manual raw|legacy [--view-only]\nVideo: UU_VIEWER_CODEC=h264 forces H.264; UU_VIEWER_CHROMA=444 requests true color (default 4:2:0).\nAudio: UU_VIEWER_AUDIO=0 disables playback. UU_VIEWER_VIEW_ONLY=1 disables desktop input.\nDevice-list method/JSON pointers and compatibility shape require verified operator configuration.\nQR login reuses the sibling uuremote-server login command. Never run login in a captured log.\nEcho readiness is transport observation only; desktop sessions send one sendVideoTrack RPC (like the official iPhone viewer).";
const DEFAULT_SHAPE:&str=r#"{"capture_type":1,"platform":3,"client_version":"4.42.0","width":1920,"height":1080,"fps":60,"chroma":1,
"decoders":[{"fps":60,"codec":1,"width":3840,"height":2160,"chroma":1}],"display_modes":[[1920,1080,60]],
"displays":[{"id":1,"fps":60,"type":0,"hdr":0}],
+3
View File
@@ -45,6 +45,9 @@ package = "webrtc-mdns"
[dependencies.rand]
version = "0.8"
[dependencies.rustls-native-certs]
version = "0.8"
[dependencies.serde]
version = "1"
features = ["derive"]
+3
View File
@@ -11,3 +11,6 @@ the TURN servers but whose TCP goes through an HTTP proxy.
application with `set_relay_transport`), adds TLS for `turns:`, and exposes the stream to the
unchanged `turn` client as datagrams: one STUN message or ChannelData frame (with its 4-byte TCP
padding) per read. `agent_gather.rs` uses it for `ProtoType::Tcp` URLs. UDP gathering is unchanged.
TLS trusts the system certificate store (`rustls-native-certs`, as OpenSSL does) plus the bundled
Mozilla roots. A name mismatch is accepted only when the TURN URL is an IP literal.
+3
View File
@@ -86,7 +86,10 @@ async fn tls_connect(tcp: TcpStream, host: &str)
-> Result<tokio_rustls::client::TlsStream<TcpStream>, String> {
use tokio_rustls::rustls::{self, client::WebPkiServerVerifier, pki_types::ServerName};
let provider = Arc::new(rustls::crypto::ring::default_provider());
// System store first (it holds any CA the host's administrator added, e.g. for a TLS-inspecting
// proxy, as OpenSSL would use), then the bundled Mozilla roots.
let mut roots = rustls::RootCertStore::empty();
roots.add_parsable_certificates(rustls_native_certs::load_native_certs().certs);
roots.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
let inner = WebPkiServerVerifier::builder_with_provider(Arc::new(roots), provider.clone()).build()
.map_err(|e| format!("TURN TLS setup: {e}"))?;