feat(aiturk): phone link works from any network through an end-to-end encrypted tunnel (1.0.0-beta.16)

The phone link no longer depends on the local network. The IDE dials out to
turkservis.online and bridges tunnel streams to its own TLS proxy on
loopback; the phone runs TLS to the pinned IDE certificate inside the
tunnel, so the relay only carries ciphertext. The proxy binds to 127.0.0.1
by default and enabling the feature never asks for a firewall rule; direct
same-network access is an explicit option. The window shows the real relay,
listener and firewall state, and pairing no longer needs local addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8ppceaR5s6cvMnm7uGRnf
This commit is contained in:
yilsemandClaude Opus 5.5 committed 2026-10-05 04:22:51 +03:00
1 parent 03d3803dfc
commit 2ed9a6b2de
11 files changed
+2905 -130

No files matched your search

+22 -4
View File
@@ -1,4 +1,4 @@
import { execFileSync, spawn } from 'node:child_process'
import { execFile, execFileSync, spawn } from 'node:child_process'
import crypto from 'node:crypto'
import fs from 'node:fs'
import http from 'node:http'
@@ -32,6 +32,7 @@ import {
shell,
systemPreferences
} from 'electron'
import { WebSocket as RelayWebSocket } from 'ws'
import { classifyActiveRuntime, needsPackagedRuntimeUpgrade } from './active-runtime-state'
import { createAiturkCliRunner, createAiturkLogin } from './aiturk-login'
@@ -17866,16 +17867,33 @@ function getMobileLink(): MobileLink {
return { baseUrl: connection.baseUrl, token: connection.token }
},
isRemoteMode: mobileLinkRemoteMode,
firewall: createWindowsFirewall({ spawn, platform: process.platform, env: process.env }),
firewall: createWindowsFirewall({
spawn,
platform: process.platform,
env: process.env,
// Read-only rule query (fixed arguments, no shell, no elevation). netsh answers in the
// console code page; latin1 keeps every byte and the parser needs no translated word.
run: (file, args) =>
new Promise(resolve => {
execFile(file, args, { windowsHide: true, timeout: 8000, encoding: 'latin1', maxBuffer: 256 * 1024 }, (error, stdout) => {
const code = error ? (typeof (error as { code?: unknown }).code === 'number' ? ((error as { code?: unknown }).code as number) : null) : 0
resolve({ code, stdout: String(stdout ?? '') })
})
})
}),
fetch: (url, init) => fetch(url, init as RequestInit),
// Outbound relay socket (turkservis.online) and the pinned loopback sockets to our own proxy.
WebSocket: RelayWebSocket,
addresses: async () => selectLanAddresses(os.networkInterfaces(), await defaultRouteAddress()),
version: app.getVersion(),
pcName: os.hostname(),
platform: process.platform,
// Method + path + status only (no token, code, query or body). Successful
// API traffic is not logged; pairing and refusals are, for diagnosis.
// API traffic is not logged; pairing and refusals are, for diagnosis. Relay
// lines are status changes only ("relay connected", "relay failed:<code>").
log: line => {
if (/ \/aiturk\//.test(line) || / [45]\d\d$/.test(line)) {
if (/^relay /.test(line) || / \/aiturk\//.test(line) || / [45]\d\d$/.test(line)) {
rememberLog(`[mobile-lan] ${line}`)
}
}