Compare commits

..
Author SHA1 Message Date
734f50a80f Merge pull request 'docs: remote access to a Sunshine host over Tailscale or Headscale (untested)' (#2) from docs/remote-access into master
Some checks failed
CI / Build (iOS) (push) Has been cancelled
CI / Build (tvOS) (push) Has been cancelled
2026-11-05 10:51:17 +00:00
9571d78d7c Merge pull request 'README: publish health stays independent of every other feature' (#1) from kiko/publish-independence-rule into master
Some checks failed
CI / Build (iOS) (push) Has been cancelled
CI / Build (tvOS) (push) Has been cancelled
2026-11-05 10:51:12 +00:00
Kiko
634c72c5fb docs: remote access conditions, Wireguard-only Sunshine, jailbroken iPad
Some checks failed
CI / Build (iOS) (push) Has been cancelled
CI / Build (tvOS) (push) Has been cancelled
CI / Build (iOS) (pull_request) Has been cancelled
CI / Build (tvOS) (pull_request) Has been cancelled
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 10:51:02 +00:00
Kiko
113e352789 README: say the OBS bridge role is planned, not present
Some checks failed
CI / Build (iOS) (push) Has been cancelled
CI / Build (tvOS) (push) Has been cancelled
CI / Build (iOS) (pull_request) Has been cancelled
CI / Build (tvOS) (pull_request) Has been cancelled
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 10:50:52 +00:00
Kiko
fa4cf9ea8d Add docs/remote-access.md: Tailscale and Headscale options (untested)
Some checks failed
CI / Build (iOS) (push) Has been cancelled
CI / Build (tvOS) (push) Has been cancelled
CI / Build (iOS) (pull_request) Has been cancelled
CI / Build (tvOS) (pull_request) Has been cancelled
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 00:37:46 +00:00
Kiko
40ca1e2a81 README: publish health stays independent of every other feature
Some checks failed
CI / Build (iOS) (pull_request) Has been cancelled
CI / Build (tvOS) (pull_request) Has been cancelled
CI / Build (iOS) (push) Has been cancelled
CI / Build (tvOS) (push) Has been cancelled
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 16:55:52 +00:00
Cameron Gutman
02dc978049 Switch to GitHub Actions 2026-09-26 16:07:06 -05:00
Cameron Gutman
064723092b Stringify YUV 4:4:4 video formats 2026-09-26 16:01:17 -05:00
Cameron Gutman
ca0efbdb5b Distinguish between Enter and Numpad Enter 2026-09-26 16:00:45 -05:00
Cameron Gutman
5cc4076d94 Update project to Xcode 27 recommended settings 2026-09-26 15:47:11 -05:00
Cameron Gutman
938f4b4589 Update moonlight-common-c 2026-09-26 15:45:47 -05:00
Cameron Gutman
7c79fcc6a2 Raise deployment target for Xcode 27 2026-09-26 15:38:07 -05:00
14 changed files with 393 additions and 455 deletions

45
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,45 @@
name: CI
on:
push:
pull_request:
branches:
- master
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build (${{ matrix.platform }})
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- scheme: Moonlight
sdk: iphonesimulator
platform: iOS
- scheme: Moonlight TV
sdk: appletvsimulator
platform: tvOS
steps:
- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive
- name: Download ${{ matrix.platform }} platform
run: xcodebuild -downloadPlatform ${{ matrix.platform }}
- name: Build Debug
run: xcodebuild -project Moonlight.xcodeproj -scheme "${{ matrix.scheme }}" -configuration Debug -sdk ${{ matrix.sdk }} clean build
- name: Build Release
run: xcodebuild -project Moonlight.xcodeproj -scheme "${{ matrix.scheme }}" -configuration Release -sdk ${{ matrix.sdk }} clean build

View file

@ -1,59 +0,0 @@
name: GameCult iOS 14 IPA
# Builds an unsigned device IPA for TrollStore on iOS/iPadOS 14.
# Upstream raised the deployment target to iOS 15 in 7c79fcc ("for Xcode 27");
# this branch sits on its parent 159ffdb (target iOS 12) and builds with Xcode 16.
on:
push:
branches:
- gamecult/ios14-build
workflow_dispatch:
permissions:
contents: read
jobs:
ipa:
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Select Xcode 16
run: |
ls -d /Applications/Xcode_16*.app
XC=$(ls -d /Applications/Xcode_16*.app | sort -V | tail -1)
sudo xcode-select -s "$XC/Contents/Developer"
xcodebuild -version
- name: Build unsigned device app
run: |
xcodebuild -project Moonlight.xcodeproj -scheme Moonlight \
-configuration Release -sdk iphoneos \
-destination 'generic/platform=iOS' \
-derivedDataPath build \
CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" \
build
- name: Package IPA
run: |
APP=$(ls -d build/Build/Products/Release-iphoneos/*.app | head -1)
/usr/libexec/PlistBuddy -c 'Print :MinimumOSVersion' "$APP/Info.plist"
# Embed the entitlements with an ad-hoc signature on the main binary;
# TrollStore keeps them when it signs the app on install.
EXE=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$APP/Info.plist")
codesign -f -s - --entitlements GameCult/TrollStore.entitlements "$APP/$EXE"
codesign -d --entitlements - "$APP/$EXE"
mkdir Payload
cp -R "$APP" Payload/
zip -qry Moonlight-ios14-unsigned.ipa Payload
shasum -a 256 Moonlight-ios14-unsigned.ipa
- name: Upload IPA
uses: actions/upload-artifact@v4
with:
name: Moonlight-ios14-unsigned
path: Moonlight-ios14-unsigned.ipa

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- Lets the IOHID gamepad fallback in ControllerSupport.m open IOHIDLibUserClient.
Without it the kernel's sandbox hook closes the client and IOServiceOpen returns
kIOReturnNotPermitted. The platform policy reads the first key; the app container
profile reads only the exception key. TrollStore keeps both in the binary. -->
<key>com.apple.security.iokit-user-client-class</key>
<array>
<string>IOHIDLibUserClient</string>
</array>
<key>com.apple.security.exception.iokit-user-client-class</key>
<array>
<string>IOHIDLibUserClient</string>
</array>
</dict>
</plist>

View file

@ -19,9 +19,6 @@ typedef struct {
} controller_touch_context_t;
@property (nullable, nonatomic, retain) GCController* gamepad;
// IOHIDDeviceRef for a gamepad that GameController doesn't expose (see ControllerSupport.m)
@property (nullable, nonatomic) void* hidDevice;
@property (nullable, nonatomic, retain) NSMutableData* hidReportBuffer;
@property (nonatomic) int playerIndex;
@property (nonatomic) int lastButtonFlags;
@property (nonatomic) int emulatingButtonFlags;

View file

@ -17,45 +17,8 @@
@import GameController;
@import AudioToolbox;
// The iOS SDK ships IOKit without its HID headers, though IOKit exports these
// functions. They are declared here for the IOHID gamepad fallback below.
__asm__(".linker_option \"-framework\", \"IOKit\"");
typedef struct __IOHIDManager* IOHIDManagerRef;
typedef struct __IOHIDDevice* IOHIDDeviceRef;
typedef void (*IOHIDDeviceCallback)(void* context, int32_t result, void* sender, IOHIDDeviceRef device);
typedef void (*IOHIDReportCallback)(void* context, int32_t result, void* sender, uint32_t type, uint32_t reportID, uint8_t* report, CFIndex reportLength);
extern IOHIDManagerRef IOHIDManagerCreate(CFAllocatorRef allocator, uint32_t options);
extern void IOHIDManagerSetDeviceMatching(IOHIDManagerRef manager, CFDictionaryRef matching);
extern void IOHIDManagerRegisterDeviceMatchingCallback(IOHIDManagerRef manager, IOHIDDeviceCallback callback, void* context);
extern void IOHIDManagerRegisterDeviceRemovalCallback(IOHIDManagerRef manager, IOHIDDeviceCallback callback, void* context);
extern void IOHIDManagerScheduleWithRunLoop(IOHIDManagerRef manager, CFRunLoopRef runLoop, CFStringRef runLoopMode);
extern void IOHIDManagerUnscheduleFromRunLoop(IOHIDManagerRef manager, CFRunLoopRef runLoop, CFStringRef runLoopMode);
extern int32_t IOHIDManagerOpen(IOHIDManagerRef manager, uint32_t options);
extern int32_t IOHIDManagerClose(IOHIDManagerRef manager, uint32_t options);
extern int32_t IOHIDDeviceOpen(IOHIDDeviceRef device, uint32_t options);
extern void IOHIDDeviceRegisterInputReportCallback(IOHIDDeviceRef device, uint8_t* report, CFIndex reportLength, IOHIDReportCallback callback, void* context);
extern int32_t IOHIDDeviceSetReport(IOHIDDeviceRef device, uint32_t reportType, CFIndex reportID, const uint8_t* report, CFIndex reportLength);
#define kIOHIDReportTypeOutput 1
// Xbox One S controller on Microsoft's Bluetooth LE firmware (5.x). GameController
// on iOS 14.4 never exposes it as a GCController, so it is read over IOHID instead.
// Its input report 1 is 17 bytes: report ID, four 16-bit sticks (0-65535, Y down),
// two 10-bit triggers, a 1-8 hat (0 = released), 15 buttons and a consumer byte.
// Output report 3 drives rumble. The layout matches SDL's HIDAPI Xbox One driver.
#define XBOX_BLE_VID 0x045E
#define XBOX_BLE_PID 0x0B20
#define XBOX_BLE_INPUT_REPORT_LEN 17
static const double MOUSE_SPEED_DIVISOR = 1.25;
// Called from the IOHID C callbacks, whose bodies are compiled before these methods
@interface ControllerSupport ()
-(Controller*) controllerForHIDDevice:(IOHIDDeviceRef)device;
-(void) handleXboxBLEReport:(Controller*)limeController report:(const uint8_t*)report length:(CFIndex)length;
-(void) addHIDDevice:(IOHIDDeviceRef)device;
-(void) removeController:(Controller*)limeController;
@end
@implementation ControllerSupport {
id _controllerConnectObserver;
id _controllerDisconnectObserver;
@ -75,8 +38,6 @@ static const double MOUSE_SPEED_DIVISOR = 1.25;
OnScreenControls *_osc;
Controller *_oscController;
IOHIDManagerRef _hidManager;
#define EMULATING_SELECT 0x1
#define EMULATING_SPECIAL 0x2
@ -103,15 +64,7 @@ static const double MOUSE_SPEED_DIVISOR = 1.25;
// No connected controller for this player
return;
}
if (controller.hidDevice) {
// Output report 3: enable both handle motors, magnitudes 0-100,
// maximum duration, no delay, repeated until the next report.
uint8_t report[] = { 0x03, 0x03, 0x00, 0x00, lowFreqMotor / 655, highFreqMotor / 655, 0xFF, 0x00, 0xEB };
IOHIDDeviceSetReport((IOHIDDeviceRef)controller.hidDevice, kIOHIDReportTypeOutput, report[0], report, sizeof(report));
return;
}
[controller.lowFreqMotor setMotorAmplitude:lowFreqMotor];
[controller.highFreqMotor setMotorAmplitude:highFreqMotor];
}
@ -664,19 +617,11 @@ static const double MOUSE_SPEED_DIVISOR = 1.25;
LB_FLAG | RB_FLAG | LS_CLK_FLAG | RS_CLK_FLAG | A_FLAG | B_FLAG | X_FLAG | Y_FLAG;
}
}
else if (limeController.hidDevice) {
// Xbox One S on Bluetooth LE firmware, read over IOHID
type = LI_CTYPE_XBOX;
capabilities = LI_CCAP_RUMBLE;
supportedButtonFlags =
PLAY_FLAG | BACK_FLAG | SPECIAL_FLAG | UP_FLAG | DOWN_FLAG | LEFT_FLAG | RIGHT_FLAG |
LB_FLAG | RB_FLAG | LS_CLK_FLAG | RS_CLK_FLAG | A_FLAG | B_FLAG | X_FLAG | Y_FLAG;
}
// Report the new controller to the host
// NB: This will fail if the connection hasn't been fully established yet
// and we will try again later.
if (LiSendControllerArrivalEvent(limeController.playerIndex,
if (LiSendControllerArrivalEvent(controller.playerIndex,
[self getActiveGamepadMask],
type,
supportedButtonFlags,
@ -971,167 +916,6 @@ static const double MOUSE_SPEED_DIVISOR = 1.25;
#endif
}
-(Controller*) controllerForHIDDevice:(IOHIDDeviceRef)device
{
for (Controller* controller in [_controllers allValues]) {
if (controller.hidDevice == device) {
return controller;
}
}
return nil;
}
-(void) handleXboxBLEReport:(Controller*)limeController report:(const uint8_t*)report length:(CFIndex)length
{
if (length < XBOX_BLE_INPUT_REPORT_LEN || report[0] != 1) {
return;
}
uint8_t buttons1 = report[14];
uint8_t buttons2 = report[15];
if (_swapABXYButtons) {
UPDATE_BUTTON_FLAG(limeController, B_FLAG, buttons1 & 0x01);
UPDATE_BUTTON_FLAG(limeController, A_FLAG, buttons1 & 0x02);
UPDATE_BUTTON_FLAG(limeController, Y_FLAG, buttons1 & 0x08);
UPDATE_BUTTON_FLAG(limeController, X_FLAG, buttons1 & 0x10);
}
else {
UPDATE_BUTTON_FLAG(limeController, A_FLAG, buttons1 & 0x01);
UPDATE_BUTTON_FLAG(limeController, B_FLAG, buttons1 & 0x02);
UPDATE_BUTTON_FLAG(limeController, X_FLAG, buttons1 & 0x08);
UPDATE_BUTTON_FLAG(limeController, Y_FLAG, buttons1 & 0x10);
}
UPDATE_BUTTON_FLAG(limeController, LB_FLAG, buttons1 & 0x40);
UPDATE_BUTTON_FLAG(limeController, RB_FLAG, buttons1 & 0x80);
// The consumer byte carries View as well on some firmware revisions
UPDATE_BUTTON_FLAG(limeController, BACK_FLAG, (buttons2 & 0x04) || (report[16] & 0x01));
UPDATE_BUTTON_FLAG(limeController, PLAY_FLAG, buttons2 & 0x08);
UPDATE_BUTTON_FLAG(limeController, SPECIAL_FLAG, buttons2 & 0x10);
UPDATE_BUTTON_FLAG(limeController, LS_CLK_FLAG, buttons2 & 0x20);
UPDATE_BUTTON_FLAG(limeController, RS_CLK_FLAG, buttons2 & 0x40);
// Hat: 1 = up, clockwise through 8 = up-left, 0 = released
uint8_t hat = report[13];
UPDATE_BUTTON_FLAG(limeController, UP_FLAG, hat == 1 || hat == 2 || hat == 8);
UPDATE_BUTTON_FLAG(limeController, RIGHT_FLAG, hat >= 2 && hat <= 4);
UPDATE_BUTTON_FLAG(limeController, DOWN_FLAG, hat >= 4 && hat <= 6);
UPDATE_BUTTON_FLAG(limeController, LEFT_FLAG, hat >= 6 && hat <= 8);
// Sticks are unsigned with Y pointing down; Moonlight wants signed with Y pointing up
#define XBOX_BLE_AXIS(offset) ((int)(report[(offset)] | (report[(offset) + 1] << 8)) - 0x8000)
#define XBOX_BLE_AXIS_Y(offset) ((short)MIN(-XBOX_BLE_AXIS(offset), 0x7FFF))
[self updateLeftStick:limeController x:XBOX_BLE_AXIS(1) y:XBOX_BLE_AXIS_Y(3)];
[self updateRightStick:limeController x:XBOX_BLE_AXIS(5) y:XBOX_BLE_AXIS_Y(7)];
#undef XBOX_BLE_AXIS
#undef XBOX_BLE_AXIS_Y
// Triggers are 10 bits
[self updateTriggers:limeController
left:((report[9] | (report[10] << 8)) & 0x3FF) >> 2
right:((report[11] | (report[12] << 8)) & 0x3FF) >> 2];
[self updateFinished:limeController];
}
static void hidReportCallback(void* context, int32_t result, void* sender, uint32_t type, uint32_t reportID, uint8_t* report, CFIndex reportLength)
{
ControllerSupport* me = (__bridge ControllerSupport*)context;
Controller* limeController = [me controllerForHIDDevice:(IOHIDDeviceRef)sender];
if (limeController) {
[me handleXboxBLEReport:limeController report:report length:reportLength];
}
}
static void hidDeviceMatched(void* context, int32_t result, void* sender, IOHIDDeviceRef device)
{
[(__bridge ControllerSupport*)context addHIDDevice:device];
}
static void hidDeviceRemoved(void* context, int32_t result, void* sender, IOHIDDeviceRef device)
{
ControllerSupport* me = (__bridge ControllerSupport*)context;
Controller* limeController = [me controllerForHIDDevice:device];
if (limeController) {
Log(LOG_I, @"IOHID Xbox controller disconnected");
[me removeController:limeController];
}
}
-(void) addHIDDevice:(IOHIDDeviceRef)device
{
// Newer iOS versions expose this controller through GameController
// themselves; don't add a second player for the same gamepad.
if (@available(iOS 14.0, tvOS 14.0, *)) {
for (GCController* controller in [GCController controllers]) {
if ([controller.extendedGamepad isKindOfClass:[GCXboxGamepad class]]) {
Log(LOG_I, @"Ignoring IOHID Xbox controller already exposed by GameController");
return;
}
}
}
int32_t err = IOHIDDeviceOpen(device, 0);
if (err != 0) {
Log(LOG_W, @"Unable to open IOHID Xbox controller: 0x%x", err);
return;
}
Controller* limeController = [self allocateController];
if (limeController == nil) {
return;
}
limeController.hidDevice = device;
limeController.hidReportBuffer = [NSMutableData dataWithLength:64];
// The physical View and Xbox buttons make combo emulation unnecessary
limeController.supportedEmulationFlags = 0;
IOHIDDeviceRegisterInputReportCallback(device, limeController.hidReportBuffer.mutableBytes,
limeController.hidReportBuffer.length, hidReportCallback, (__bridge void*)self);
Log(LOG_I, @"IOHID Xbox controller connected");
[self reportControllerArrival:limeController];
[self updateAutoOnScreenControlMode];
[_delegate gamepadPresenceChanged];
}
-(void) startHIDGamepads
{
_hidManager = IOHIDManagerCreate(kCFAllocatorDefault, 0);
if (_hidManager == NULL) {
return;
}
NSDictionary* matching = @{ @"VendorID": @(XBOX_BLE_VID), @"ProductID": @(XBOX_BLE_PID) };
IOHIDManagerSetDeviceMatching(_hidManager, (__bridge CFDictionaryRef)matching);
IOHIDManagerRegisterDeviceMatchingCallback(_hidManager, hidDeviceMatched, (__bridge void*)self);
IOHIDManagerRegisterDeviceRemovalCallback(_hidManager, hidDeviceRemoved, (__bridge void*)self);
IOHIDManagerScheduleWithRunLoop(_hidManager, CFRunLoopGetMain(), kCFRunLoopDefaultMode);
// This needs com.apple.security.iokit-user-client-class to allow IOHIDLibUserClient,
// which only the GameCult TrollStore build carries. Without it, opening fails and
// this source stays empty.
int32_t err = IOHIDManagerOpen(_hidManager, 0);
if (err != 0) {
Log(LOG_I, @"IOHID gamepad fallback unavailable: 0x%x", err);
}
}
-(void) stopHIDGamepads
{
if (_hidManager == NULL) {
return;
}
IOHIDManagerRegisterDeviceMatchingCallback(_hidManager, NULL, NULL);
IOHIDManagerRegisterDeviceRemovalCallback(_hidManager, NULL, NULL);
IOHIDManagerUnscheduleFromRunLoop(_hidManager, CFRunLoopGetMain(), kCFRunLoopDefaultMode);
IOHIDManagerClose(_hidManager, 0);
CFRelease(_hidManager);
_hidManager = NULL;
}
-(void) updateAutoOnScreenControlMode
{
// Auto on-screen control support may not be enabled
@ -1165,14 +949,7 @@ static void hidDeviceRemoved(void* context, int32_t result, void* sender, IOHIDD
}
}
}
// An IOHID gamepad has every button, so it needs no on-screen help
for (Controller* controller in [_controllers allValues]) {
if (controller.hidDevice) {
level = OnScreenControlsLevelOff;
}
}
// If we didn't find a gamepad present and we have a keyboard or mouse, turn
// the on-screen controls off to get the overlays out of the way.
if (level == OnScreenControlsLevelFull && [ControllerSupport hasKeyboardOrMouse]) {
@ -1194,90 +971,50 @@ static void hidDeviceRemoved(void* context, int32_t result, void* sender, IOHIDD
[self updateAutoOnScreenControlMode];
}
-(Controller*) allocateController {
-(Controller*) assignController:(GCController*)controller {
for (int i = 0; i < 4; i++) {
if (!(_controllerNumbers & (1 << i))) {
_controllerNumbers |= (1 << i);
controller.playerIndex = i;
Controller* limeController = [[Controller alloc] init];
limeController.playerIndex = i;
limeController.supportedEmulationFlags = EMULATING_SPECIAL | EMULATING_SELECT;
limeController.gamepad = controller;
// If this is player 0, it shares state with the OSC
limeController.mergedWithController = _oscController;
_oscController.mergedWithController = limeController;
if (@available(iOS 13.0, tvOS 13.0, *)) {
if (controller.extendedGamepad != nil &&
controller.extendedGamepad.buttonOptions != nil) {
// Disable select button emulation since we have a physical select button
limeController.supportedEmulationFlags &= ~EMULATING_SELECT;
}
}
if (@available(iOS 14.0, tvOS 14.0, *)) {
if (controller.extendedGamepad != nil &&
controller.extendedGamepad.buttonHome != nil) {
// Disable special button emulation since we have a physical special button
limeController.supportedEmulationFlags &= ~EMULATING_SPECIAL;
}
}
// Prepare controller haptics for use
[self initializeControllerHaptics:limeController];
[_controllers setObject:limeController forKey:[NSNumber numberWithInteger:i]];
[_controllers setObject:limeController forKey:[NSNumber numberWithInteger:controller.playerIndex]];
Log(LOG_I, @"Assigning controller index: %d", i);
return limeController;
}
}
return nil;
}
-(Controller*) assignController:(GCController*)controller {
Controller* limeController = [self allocateController];
if (limeController == nil) {
return nil;
}
controller.playerIndex = limeController.playerIndex;
limeController.gamepad = controller;
if (@available(iOS 13.0, tvOS 13.0, *)) {
if (controller.extendedGamepad != nil &&
controller.extendedGamepad.buttonOptions != nil) {
// Disable select button emulation since we have a physical select button
limeController.supportedEmulationFlags &= ~EMULATING_SELECT;
}
}
if (@available(iOS 14.0, tvOS 14.0, *)) {
if (controller.extendedGamepad != nil &&
controller.extendedGamepad.buttonHome != nil) {
// Disable special button emulation since we have a physical special button
limeController.supportedEmulationFlags &= ~EMULATING_SPECIAL;
}
}
// Prepare controller haptics for use
[self initializeControllerHaptics:limeController];
return limeController;
}
-(void) removeController:(Controller*)limeController {
_controllerNumbers &= ~(1 << limeController.playerIndex);
Log(LOG_I, @"Unassigning controller index: %d", limeController.playerIndex);
// Stop haptics on this controller
[self cleanupControllerHaptics:limeController];
// Stop motion reports on this controller
[self cleanupControllerMotion:limeController];
// Stop battery reports on this controller
[self cleanupControllerBattery:limeController];
// Disassociate this controller from any controllers merged with it
if (limeController.mergedWithController) {
assert(limeController.mergedWithController.mergedWithController == limeController);
limeController.mergedWithController.mergedWithController = nil;
}
// Inform the server of the updated active gamepads before removing this controller
[self updateFinished:limeController];
[_controllers removeObjectForKey:[NSNumber numberWithInteger:limeController.playerIndex]];
// Re-evaluate the on-screen control mode
[self updateAutoOnScreenControlMode];
// Notify the delegate
[_delegate gamepadPresenceChanged];
}
-(Controller*) getOscController {
return _oscController;
}
@ -1365,11 +1102,7 @@ static void hidDeviceRemoved(void* context, int32_t result, void* sender, IOHIDD
// because the connection has not been established yet.
}
}
// Gamepads GameController doesn't expose. Devices already connected are
// matched while the run loop runs, after this initializer returns.
[self startHIDGamepads];
if (@available(iOS 14.0, tvOS 14.0, *)) {
for (GCMouse* mouse in [GCMouse mice]) {
[self registerMouseCallbacks:mouse];
@ -1412,13 +1145,35 @@ static void hidDeviceRemoved(void* context, int32_t result, void* sender, IOHIDD
}
[self unregisterControllerCallbacks:controller];
self->_controllerNumbers &= ~(1 << controller.playerIndex);
Log(LOG_I, @"Unassigning controller index: %ld", (long)controller.playerIndex);
Controller* limeController = [self->_controllers objectForKey:[NSNumber numberWithInteger:controller.playerIndex]];
if (limeController) {
[self removeController:limeController];
}
else {
self->_controllerNumbers &= ~(1 << controller.playerIndex);
// Stop haptics on this controller
[self cleanupControllerHaptics:limeController];
// Stop motion reports on this controller
[self cleanupControllerMotion:limeController];
// Stop battery reports on this controller
[self cleanupControllerBattery:limeController];
// Disassociate this controller from any controllers merged with it
if (limeController.mergedWithController) {
assert(limeController.mergedWithController.mergedWithController == limeController);
limeController.mergedWithController.mergedWithController = nil;
}
// Inform the server of the updated active gamepads before removing this controller
[self updateFinished:limeController];
[self->_controllers removeObjectForKey:[NSNumber numberWithInteger:controller.playerIndex]];
// Re-evaluate the on-screen control mode
[self updateAutoOnScreenControlMode];
// Notify the delegate
[self->_delegate gamepadPresenceChanged];
}
}];
@ -1493,9 +1248,7 @@ static void hidDeviceRemoved(void* context, int32_t result, void* sender, IOHIDD
_keyboardDisconnectObserver = nil;
_controllerNumbers = 0;
[self stopHIDGamepads];
for (Controller* controller in [_controllers allValues]) {
[self cleanupControllerHaptics:controller];
[self cleanupControllerMotion:controller];

View file

@ -202,6 +202,7 @@
break;
case UIKeyboardHIDUsageKeypadEnter:
keyCode = 0x0D;
modifierFlags |= MODIFIER_EXTENDED;
break;
case UIKeyboardHIDUsageKeypadPeriod:
keyCode = 0x6E;

View file

@ -86,8 +86,12 @@ void DrStop(void)
{
case VIDEO_FORMAT_H264:
return @"H.264";
case VIDEO_FORMAT_H264_HIGH8_444:
return @"H.264 (4:4:4)";
case VIDEO_FORMAT_H265:
return @"HEVC";
case VIDEO_FORMAT_H265_REXT8_444:
return @"HEVC (4:4:4)";
case VIDEO_FORMAT_H265_MAIN10:
if (LiGetCurrentHostDisplayHdrMode()) {
return @"HEVC Main 10 HDR";
@ -95,8 +99,17 @@ void DrStop(void)
else {
return @"HEVC Main 10 SDR";
}
case VIDEO_FORMAT_H265_REXT10_444:
if (LiGetCurrentHostDisplayHdrMode()) {
return @"HEVC Main 10 HDR (4:4:4)";
}
else {
return @"HEVC Main 10 SDR (4:4:4)";
}
case VIDEO_FORMAT_AV1_MAIN8:
return @"AV1";
case VIDEO_FORMAT_AV1_HIGH8_444:
return @"AV1 (4:4:4)";
case VIDEO_FORMAT_AV1_MAIN10:
if (LiGetCurrentHostDisplayHdrMode()) {
return @"AV1 10-bit HDR";
@ -104,6 +117,13 @@ void DrStop(void)
else {
return @"AV1 10-bit SDR";
}
case VIDEO_FORMAT_AV1_HIGH10_444:
if (LiGetCurrentHostDisplayHdrMode()) {
return @"AV1 10-bit HDR (4:4:4)";
}
else {
return @"AV1 10-bit SDR (4:4:4)";
}
default:
return @"UNKNOWN";
}

View file

@ -580,7 +580,7 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
CMSampleBufferRef sampleBuffer;
CMSampleTimingInfo sampleTiming = {kCMTimeInvalid, CMTimeMake(du->presentationTimeMs, 1000), kCMTimeInvalid};
CMSampleTimingInfo sampleTiming = {kCMTimeInvalid, CMTimeMake(du->presentationTimeUs, 1000000), kCMTimeInvalid};
status = CMSampleBufferCreateReady(kCFAllocatorDefault,
frameBlockBuffer,

View file

@ -736,8 +736,9 @@
FB290CE619B2C406004C83CF /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 1400;
LastUpgradeCheck = 2700;
ORGANIZATIONNAME = "Moonlight Game Streaming Project";
TargetAttributes = {
FB1A67522132419700507771 = {
@ -984,7 +985,6 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = DM46QST4M7;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@ -996,6 +996,7 @@
);
INFOPLIST_FILE = "Moonlight TV/Info.plist";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
IPHONEOS_DEPLOYMENT_TARGET = "$(RECOMMENDED_IPHONEOS_DEPLOYMENT_TARGET)";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -1022,7 +1023,7 @@
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 12.0;
TVOS_DEPLOYMENT_TARGET = "$(RECOMMENDED_TVOS_DEPLOYMENT_TARGET)";
};
name = Debug;
};
@ -1040,7 +1041,6 @@
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = DM46QST4M7;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@ -1052,6 +1052,7 @@
);
INFOPLIST_FILE = "Moonlight TV/Info.plist";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
IPHONEOS_DEPLOYMENT_TARGET = "$(RECOMMENDED_IPHONEOS_DEPLOYMENT_TARGET)";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -1078,7 +1079,7 @@
SWIFT_OBJC_INTERFACE_HEADER_NAME = "Moonlight-Swift.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 12.0;
TVOS_DEPLOYMENT_TARGET = "$(RECOMMENDED_TVOS_DEPLOYMENT_TARGET)";
};
name = Release;
};
@ -1112,8 +1113,10 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = DM46QST4M7;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@ -1129,9 +1132,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
@ -1168,8 +1172,10 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEVELOPMENT_TEAM = DM46QST4M7;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
@ -1182,9 +1188,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_OBJC_INTERFACE_HEADER_NAME = "";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
@ -1200,7 +1207,6 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DM46QST4M7;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Limelight/Limelight-Prefix.pch";
HEADER_SEARCH_PATHS = (
@ -1212,6 +1218,7 @@
);
INFOPLIST_FILE = "Limelight/Limelight-Info.plist";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
IPHONEOS_DEPLOYMENT_TARGET = "$(RECOMMENDED_IPHONEOS_DEPLOYMENT_TARGET)";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -1250,7 +1257,6 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DM46QST4M7;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Limelight/Limelight-Prefix.pch";
HEADER_SEARCH_PATHS = (
@ -1262,6 +1268,7 @@
);
INFOPLIST_FILE = "Limelight/Limelight-Info.plist";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
IPHONEOS_DEPLOYMENT_TARGET = "$(RECOMMENDED_IPHONEOS_DEPLOYMENT_TARGET)";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",

View file

@ -1,20 +1,6 @@
# GameCult build of Moonlight iOS for iOS/iPadOS 14
This fork exists for one artifact: an **unsigned Moonlight IPA that installs with TrollStore on iOS/iPadOS 14**, for a device that cannot use the App Store.
- **Branch:** `gamecult/ios14-build`, based on upstream commit `159ffdb` (2026-09-26). That is the last commit before upstream raised the minimum to iOS 15 in `7c79fcc`, a change made for Xcode 27.
- **Build:** `.github/workflows/gamecult-ios14-ipa.yml` runs on GitHub's macOS runner with Xcode 16 and uploads `Moonlight-ios14-unsigned.ipa` as a workflow artifact.
- **Install:** with TrollStore, which signs the app itself.
- **Xbox One S on Bluetooth LE firmware:** iOS 14.4 connects this controller (VID `0x045E`, PID `0x0B20`, firmware 5.x) as a HID device, but GameController never exposes it, so stock Moonlight sees no controller. `Limelight/Input/ControllerSupport.m` adds an IOHIDManager source for it. It parses input report 1 (the layout SDL's HIDAPI Xbox One driver uses), feeds the same controller path as GameController pads, and drives rumble through output report 3. Controllers that GameController recognises are untouched. Opening the device needs the entitlement in `GameCult/TrollStore.entitlements` (`com.apple.security.iokit-user-client-class` naming `IOHIDLibUserClient`). The workflow embeds it with an ad-hoc signature, and TrollStore keeps it.
- **Status:** a personal build, not a maintained distribution. For a supported Moonlight, use the [upstream app](https://github.com/moonlight-stream/moonlight-ios).
Everything below is upstream's README.
---
# Moonlight iOS/tvOS
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/kwv8vpwr457lqn25/branch/master?svg=true)](https://ci.appveyor.com/project/cgutman/moonlight-ios/branch/master)
[![CI](https://github.com/moonlight-stream/moonlight-ios/actions/workflows/ci.yml/badge.svg)](https://github.com/moonlight-stream/moonlight-ios/actions/workflows/ci.yml)
[Moonlight for iOS/tvOS](https://moonlight-stream.org) is an open source client for [Sunshine](https://github.com/LizardByte/Sunshine) and NVIDIA GameStream. Moonlight for iOS/tvOS allows you to stream your full collection of games and apps from your powerful desktop computer to your iOS device or Apple TV.
@ -36,3 +22,6 @@ Check out [the Moonlight wiki](https://github.com/moonlight-stream/moonlight-doc
* In the "Team" dropdown, select your name. If your name doesn't appear, you may need to sign into Xcode with your Apple account.
* Change the "Bundle Identifier" to something different. You can add your name or some random letters to make it unique.
* Now you can select your Apple device in the top bar as a target and click the Play button to run.
## GameCult fork: publish health is independent
This fork is meant to take on the OBS bridge role that Ratatoskr used to hold; none of that code exists on this branch yet, so this is a rule for code to come. Whatever Moonlight publishes toward OBS, publish state is its own path, and no other feature may touch it. Sound, and any feature added after it, must never block, delay, or report on the publish path. A silent publish must never read as healthy: no output reads as unknown or failed, never as fine.

View file

@ -1,24 +0,0 @@
version: 0.0.0.{build}
clone_depth: 1
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: macOS-Sonoma
SCHEME: Moonlight
SDK: iphonesimulator
PLATFORM: iOS
- APPVEYOR_BUILD_WORKER_IMAGE: macOS-Sonoma
SCHEME: Moonlight TV
SDK: appletvsimulator
PLATFORM: tvOS
before_build:
- 'git submodule update --init --recursive'
- sh: 'xcodebuild -downloadPlatform $PLATFORM'
build_script:
- sh: xcodebuild -project Moonlight.xcodeproj -scheme "$SCHEME" -configuration Debug -sdk $SDK clean build
- sh: xcodebuild -project Moonlight.xcodeproj -scheme "$SCHEME" -configuration Release -sdk $SDK clean build
deploy: off

209
docs/remote-access.md Normal file
View file

@ -0,0 +1,209 @@
# Remote access: iPad to a Sunshine host on restrictive wifi
**Status: planning document. Every step below is untested.** Nothing here has been run
against the real host, iPad, or network. Doc claims are cited; anything not found in the
cited docs is marked *unverified*. Nothing in this repo changes: this is a design note.
## Conditions in force
Set by Eureka (who holds the Wireguard network and Yggdrasil). They bound every option
below; an option that cannot meet them is out.
- **Raven's Sunshine host is a yes in principle only if** it is bound to the Wireguard
interface and paired by Meta, and never exposed (no public or LAN-wide listener, no
port forward). *Untested and unverified: how to bind Sunshine to one interface. This
doc has not found a Sunshine setting for it; check the Sunshine configuration page and
the host firewall before relying on either.*
- **Minds get no access to the iPad** until Meta gives its Yggdrasil address and says yes.
Nothing here is to be run from, or opened on, Yggdrasil before that. Option B below is
a design only.
- **Pairing is Meta's act**, not a Mind's.
## Client device
The iPad has no App Store and runs an old jailbroken iOS (Taurine). The fork reaches it
through TrollStore, not the App Store. Consequences, none of them tested:
- Step 3 of Option A ("install the Tailscale iOS app") and the Headscale "custom
coordination server" path both assume the App Store app. *Unverified: whether any
Tailscale or Wireguard client can be installed on this iPad, and whether it runs on that
iOS version.* This is now the first likely blocker, ahead of any management profile.
- *Unverified: whether a VPN client installed via TrollStore can create a VPN
configuration on a Taurine device.* A Wireguard client on the iPad is the natural fit
for the conditions above, and it is equally untested.
- Whether this fork builds for that iOS version is a build question for the
`gamecult/ios14-build` branch, not settled here.
## Problem
Moonlight (this client) streams from a Sunshine host (called **Raven** here) over several
TCP and UDP ports. The target situation is an iPad on managed wifi that blocks those
ports, with no mobile data fallback. The usual escape is an overlay VPN whose traffic
looks like ordinary HTTPS. Only outbound TCP 443 is assumed to work.
Sunshine's base port is 47989 and other ports are offset from it
([Sunshine configuration](https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2configuration.html)).
That page does not list the offsets; read the exact list from Sunshine's config UI. Pairing
uses the Sunshine web UI (default `https://<host>:47990`, PIN page)
([Sunshine getting started](https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2getting__started.html)).
The web UI is LAN-only by default (`origin_web_ui_allowed: lan`); a tailnet address is not
the LAN, so pairing may need that setting changed or must be done on the LAN first.
*Unverified: whether tailnet source addresses count as `lan`.*
## What the overlay must carry
Moonlight video/audio/input are UDP. Tailscale and Headscale carry arbitrary IP inside
WireGuard, so UDP flows unchanged. When no direct path exists, the WireGuard packets
travel inside a TCP/HTTPS connection to a DERP relay.
## Option A: Tailscale (hosted control plane, Tailscale DERP)
### How it behaves on a 443-only network
- Outbound requirements: TCP 443 for coordination and DERP; UDP 41641 and UDP 3478 only
improve direct connections. If only 443 is allowed, "connectivity still works" via
relays, but not as fast as peer-to-peer
([Tailscale firewall ports](https://tailscale.com/kb/1082/firewall-ports)).
- Every connection starts relayed and then tries to upgrade to direct; DERP is the
fallback when direct fails. Relayed traffic is end-to-end WireGuard encrypted
([connection types](https://tailscale.com/kb/1257/connection-types)).
- Tailscale warns DERP has limited quality of service and lower throughput. Its sample
`tailscale ping` output shows DERP at roughly 40 to 280 ms. Those are examples, not
predictions for this site.
### Steps (all untested)
1. Create or identify the tailnet and its owner (see Open Questions).
2. Install Tailscale on Raven; sign in to that tailnet.
3. Install a Tailscale client on the iPad (no App Store there; see Client device); sign in to the same tailnet. *Unverified:
whether the managed iPad's profile permits installing a VPN app or creating a VPN
configuration. This is the first likely blocker.*
4. In the Tailscale admin console or `tailscale status` on Raven, note Raven's tailnet IP
(`100.x.y.z`) or MagicDNS name.
5. On the LAN beforehand if possible, pair Moonlight with Raven normally. If pairing over
the tailnet: in Moonlight, add the host manually by tailnet IP; enter the PIN in
Sunshine's web UI.
6. Start a stream over the tailnet; check with `tailscale ping raven` (on any tailnet
device) whether the path is `direct` or `via DERP(...)`.
7. If relayed and unplayable, lower Moonlight resolution, FPS and bitrate first.
### Latency limits when relayed
Relayed means TCP-in-the-middle for UDP-like traffic: head-of-line blocking on loss, an
extra round trip through the nearest DERP region, and a throughput ceiling. Expect
playable desktop and slow-paced use, not guaranteed competitive-game latency. *No
measurement exists for this site; measure with `tailscale ping` and a trial stream.*
## Option B: self-hosted Headscale on Yggdrasil behind 443
Headscale is an open-source reimplementation of the Tailscale control server; the
official Tailscale iOS app can point at it
([Apple clients](https://headscale.net/stable/usage/connect/apple/): account menu,
"Use custom coordination server", enter the `https://` URL).
### Needs Eureka's approval first
Nothing below is done until Eureka approves each item:
- A new public hostname and DNS record for the control server.
- A public TLS certificate for it, and where TLS terminates.
- A new daemon (Headscale) on Yggdrasil and who deploys and survives it (Idunn
authority applies; this doc does not choose).
- Public exposure of 443 for this hostname, and possibly UDP 3478 (see below).
- A relay choice: reuse Tailscale's public DERP map (the iPad still reaches Tailscale's
relays on 443), or run Headscale's embedded DERP.
- Who may register nodes, and key expiry policy.
### Minimal configuration shape (untested; read the example config for your release tag
before use, per [config docs](https://headscale.net/stable/ref/configuration/))
- `server_url`: the public `https://` hostname on 443.
- `listen_addr`: loopback or internal only; reverse proxy in front.
- TLS cert/key paths left empty when a proxy terminates TLS (Headscale then logs
`listening without TLS`, which is expected)
([reverse proxy](https://headscale.net/stable/ref/integration/reverse-proxy/)).
- `trusted_proxies` set to the proxy address.
- A sqlite database path, a noise private key path, IP prefixes, and a DNS block as in the
shipped example config.
- `derp.urls`: keep Tailscale's default map for the first trial. Removing it makes the
embedded server a single point of failure
([DERP](https://headscale.net/stable/ref/derp/)).
- Optional: `derp.server.enabled: true` plus `ipv4`/`ipv6`, `verify_clients: true`.
### Proxy constraints from the docs
- The proxy must support WebSockets: the control protocol upgrades via POST with
`Upgrade: tailscale-control-protocol`. Cloudflare proxies and Tunnels are unsupported.
- Port summary: tcp/443 public; tcp/80 only for built-in Let's Encrypt HTTP-01; udp/3478
public if embedded DERP is enabled; tcp/50443 only for gRPC remote control; tcp/9090
not public ([requirements](https://headscale.net/stable/setup/requirements/)).
- STUN for embedded DERP needs udp/3478, which an HTTPS reverse proxy cannot carry. On a
443-only client network STUN is blocked anyway, so DERP-over-443 is the path that
matters. *Unverified: the docs do not say whether the embedded DERP's HTTPS endpoint
works behind a reverse proxy.* Simplest trial: leave Tailscale's DERP map in place.
- The reverse-proxy page is community maintained and may be outdated.
### Exposure added
One new public HTTPS hostname fronting a control plane; optionally a public relay and UDP
3478. Raven and the iPad gain no inbound ports; Sunshine ports stay on the tailnet. The
tailnet's ACLs should restrict the iPad to Raven's Moonlight ports only
(*unverified in this environment; ACL syntax differs between Headscale versions*).
## Failure ladder
Run top to bottom, stopping at the first success. Everything is untested.
1. Home/LAN: confirm Moonlight streams to Raven with no overlay (baseline).
2. Tailscale on both devices at the LAN: confirm tailnet IP works, `tailscale ping` is
direct.
3. iPad on the restrictive wifi, Tailscale connected: does the app reach "Connected"?
If not: is VPN installation or profile blocked by management (stop; this is policy,
not network), or is 443 to the control plane filtered or TLS-intercepted?
4. `tailscale ping raven` from the iPad's side (use another tailnet device, or app
status): `direct` is best, `via DERP` means relay.
5. Relayed but stream stutters: lower bitrate, resolution, FPS; try H.264 over HEVC if the
iPad decoder is struggling (decode, not network, may be the limit).
6. Control plane reachable but no DERP: network may TLS-intercept or block Tailscale
domains. Option B with a hostname that is not a known Tailscale domain is the next step.
7. Wifi blocks everything but ordinary web browsing, and VPN apps are policy-blocked:
neither option works. Fall back to a browser-based path or a different network.
## A or B
| Question | A: Tailscale hosted | B: Headscale on Yggdrasil |
|---|---|---|
| Time to first test | Hours | Days (approvals, DNS, TLS, deploy) |
| New public exposure | None | Hostname, cert, daemon, maybe UDP 3478 |
| Works if network blocks Tailscale domains | No | Possibly (own hostname) |
| Works if network only does 443 | Yes, relayed | Yes, relayed, via Tailscale DERP or own |
| Control-plane ownership | Tailscale account holder | Eureka / GameCult |
| Latency when relayed | Tailscale DERP regions | Same, or own DERP region if run |
| Ongoing work | None | Upkeep, updates, backups |
| Recommended | Try first | Only if A fails at ladder step 3 or 6 |
## Open Questions
- Where does Raven sit on the network (same LAN as the iPad's home, behind carrier NAT,
behind a router that can forward ports, wired or wifi)? It decides whether direct
connections are plausible at all.
- Who holds the tailnet account for Option A (individual, org, shared), and who can add
devices and edit ACLs?
- Can any VPN client be installed on the Taurine iPad at all (App Store absent, TrollStore only)? Does its management policy allow a third-party VPN app? Nothing else matters if
not.
- Is any measurement available of latency from the restrictive network to the nearest
DERP region?
- If Option B is chosen: does Eureka want Headscale in the Yggdrasil deployment model, and
who owns it?
## Sources
- <https://tailscale.com/kb/1257/connection-types>
- <https://tailscale.com/kb/1082/firewall-ports>
- <https://headscale.net/stable/ref/derp/>
- <https://headscale.net/stable/ref/configuration/>
- <https://headscale.net/stable/ref/integration/reverse-proxy/>
- <https://headscale.net/stable/setup/requirements/>
- <https://headscale.net/stable/usage/connect/apple/>
- <https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2getting__started.html>
- <https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2configuration.html>

@ -1 +1 @@
Subproject commit 48d7f1ace168d07dad339718f1350979545f15d2
Subproject commit f900dd4767759c7b9d0e93bcea666b55c69ea62f

View file

@ -9,7 +9,12 @@
/* Begin PBXBuildFile section */
983091DE24CEB69B00A0835D /* ConnectionTester.c in Sources */ = {isa = PBXBuildFile; fileRef = 983091DD24CEB69B00A0835D /* ConnectionTester.c */; };
983091DF24CEB69B00A0835D /* ConnectionTester.c in Sources */ = {isa = PBXBuildFile; fileRef = 983091DD24CEB69B00A0835D /* ConnectionTester.c */; };
9857AEF01EBE85E10084F99E /* rs.c in Sources */ = {isa = PBXBuildFile; fileRef = 9857AEEE1EBE85E10084F99E /* rs.c */; };
9857AF051EBE85E10084F99E /* rs.c in Sources */ = {isa = PBXBuildFile; fileRef = 9857AF011EBE85E10084F99E /* rs.c */; };
9857AF061EBE85E10084F99E /* oblas_common.c in Sources */ = {isa = PBXBuildFile; fileRef = 9857AF031EBE85E10084F99E /* oblas_common.c */; };
9857AF071EBE85E10084F99E /* oblas_lite.c in Sources */ = {isa = PBXBuildFile; fileRef = 9857AF041EBE85E10084F99E /* oblas_lite.c */; };
9857AF081EBE85E10084F99E /* rs.c in Sources */ = {isa = PBXBuildFile; fileRef = 9857AF011EBE85E10084F99E /* rs.c */; };
9857AF091EBE85E10084F99E /* oblas_common.c in Sources */ = {isa = PBXBuildFile; fileRef = 9857AF031EBE85E10084F99E /* oblas_common.c */; };
9857AF0A1EBE85E10084F99E /* oblas_lite.c in Sources */ = {isa = PBXBuildFile; fileRef = 9857AF041EBE85E10084F99E /* oblas_lite.c */; };
98AB2E401CAD425A0089BB98 /* AudioStream.c in Sources */ = {isa = PBXBuildFile; fileRef = 98AB2E1A1CAD423B0089BB98 /* AudioStream.c */; };
98AB2E411CAD425A0089BB98 /* ByteBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 98AB2E1B1CAD423B0089BB98 /* ByteBuffer.c */; };
98AB2E421CAD425A0089BB98 /* Connection.c in Sources */ = {isa = PBXBuildFile; fileRef = 98AB2E1D1CAD423B0089BB98 /* Connection.c */; };
@ -44,7 +49,6 @@
98F145382667D847004018E3 /* RtpVideoQueue.c in Sources */ = {isa = PBXBuildFile; fileRef = 98F145342667D847004018E3 /* RtpVideoQueue.c */; };
F74BEF9F2C1A707200224667 /* OpenSSL in Frameworks */ = {isa = PBXBuildFile; productRef = F74BEF9E2C1A707200224667 /* OpenSSL */; };
F74BEFA22C1A80D000224667 /* OpenSSL in Frameworks */ = {isa = PBXBuildFile; productRef = F74BEFA12C1A80D000224667 /* OpenSSL */; };
FB1A67F821324F4900507771 /* rs.c in Sources */ = {isa = PBXBuildFile; fileRef = 9857AEEE1EBE85E10084F99E /* rs.c */; };
FB1A67FA21324F4900507771 /* AudioStream.c in Sources */ = {isa = PBXBuildFile; fileRef = 98AB2E1A1CAD423B0089BB98 /* AudioStream.c */; };
FB1A67FB21324F4900507771 /* ByteBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 98AB2E1B1CAD423B0089BB98 /* ByteBuffer.c */; };
FB1A67FC21324F4900507771 /* Connection.c in Sources */ = {isa = PBXBuildFile; fileRef = 98AB2E1D1CAD423B0089BB98 /* Connection.c */; };
@ -85,8 +89,10 @@
/* Begin PBXFileReference section */
983091DD24CEB69B00A0835D /* ConnectionTester.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ConnectionTester.c; sourceTree = "<group>"; };
9857AEEE1EBE85E10084F99E /* rs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = rs.c; path = "moonlight-common-c/reedsolomon/rs.c"; sourceTree = "<group>"; };
9857AEEF1EBE85E10084F99E /* rs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rs.h; path = "moonlight-common-c/reedsolomon/rs.h"; sourceTree = "<group>"; };
9857AF011EBE85E10084F99E /* rs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = rs.c; path = "moonlight-common-c/nanors/rs.c"; sourceTree = "<group>"; };
9857AF021EBE85E10084F99E /* rs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rs.h; path = "moonlight-common-c/nanors/rs.h"; sourceTree = "<group>"; };
9857AF031EBE85E10084F99E /* oblas_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = oblas_common.c; path = "moonlight-common-c/nanors/deps/obl/oblas_common.c"; sourceTree = "<group>"; };
9857AF041EBE85E10084F99E /* oblas_lite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = oblas_lite.c; path = "moonlight-common-c/nanors/deps/obl/oblas_lite.c"; sourceTree = "<group>"; };
98AB2DF01CAD422B0089BB98 /* callbacks.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = callbacks.c; sourceTree = "<group>"; };
98AB2DF11CAD422B0089BB98 /* ChangeLog */ = {isa = PBXFileReference; lastKnownFileType = text; path = ChangeLog; sourceTree = "<group>"; };
98AB2DF21CAD422B0089BB98 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
@ -180,13 +186,15 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9857AEED1EBE85D50084F99E /* reedsolomon */ = {
9857AF001EBE85D50084F99E /* nanors */ = {
isa = PBXGroup;
children = (
9857AEEE1EBE85E10084F99E /* rs.c */,
9857AEEF1EBE85E10084F99E /* rs.h */,
9857AF011EBE85E10084F99E /* rs.c */,
9857AF021EBE85E10084F99E /* rs.h */,
9857AF031EBE85E10084F99E /* oblas_common.c */,
9857AF041EBE85E10084F99E /* oblas_lite.c */,
);
name = reedsolomon;
name = nanors;
sourceTree = "<group>";
};
98AB2DEF1CAD422B0089BB98 /* enet */ = {
@ -310,7 +318,7 @@
FB290E2519B37A4E004C83CF = {
isa = PBXGroup;
children = (
9857AEED1EBE85D50084F99E /* reedsolomon */,
9857AF001EBE85D50084F99E /* nanors */,
98AB2E191CAD423B0089BB98 /* src */,
98AB2DEF1CAD422B0089BB98 /* enet */,
FB290E2F19B37A4E004C83CF /* Products */,
@ -375,7 +383,7 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1510;
LastUpgradeCheck = 2700;
ORGANIZATIONNAME = "Moonlight Stream";
TargetAttributes = {
FB1A67EE21324EE300507771 = {
@ -411,7 +419,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FB1A67F821324F4900507771 /* rs.c in Sources */,
9857AF081EBE85E10084F99E /* rs.c in Sources */,
9857AF091EBE85E10084F99E /* oblas_common.c in Sources */,
9857AF0A1EBE85E10084F99E /* oblas_lite.c in Sources */,
98F145362667D847004018E3 /* RtpAudioQueue.c in Sources */,
FB1A67FA21324F4900507771 /* AudioStream.c in Sources */,
FB1A67FB21324F4900507771 /* ByteBuffer.c in Sources */,
@ -448,6 +458,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9857AF051EBE85E10084F99E /* rs.c in Sources */,
9857AF061EBE85E10084F99E /* oblas_common.c in Sources */,
9857AF071EBE85E10084F99E /* oblas_lite.c in Sources */,
98C1FC142184124C0023FDDF /* SimpleStun.c in Sources */,
98F145352667D847004018E3 /* RtpAudioQueue.c in Sources */,
98AB2E401CAD425A0089BB98 /* AudioStream.c in Sources */,
@ -475,7 +488,6 @@
98AB2E541CAD427A0089BB98 /* packet.c in Sources */,
98AB2E551CAD427A0089BB98 /* peer.c in Sources */,
98AB2E561CAD427A0089BB98 /* protocol.c in Sources */,
9857AEF01EBE85E10084F99E /* rs.c in Sources */,
98AB2E571CAD427A0089BB98 /* unix.c in Sources */,
98AB2E581CAD427A0089BB98 /* win32.c in Sources */,
);
@ -500,7 +512,8 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
HEADER_SEARCH_PATHS = (
"moonlight-common-c/enet/include",
"../libs/**",
"moonlight-common-c/nanors",
"moonlight-common-c/nanors/deps/obl",
);
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
MTL_ENABLE_DEBUG_INFO = YES;
@ -510,7 +523,7 @@
SDKROOT = appletvos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 12.0;
TVOS_DEPLOYMENT_TARGET = "$(RECOMMENDED_TVOS_DEPLOYMENT_TARGET)";
VALIDATE_PRODUCT = NO;
};
name = Debug;
@ -530,7 +543,8 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
HEADER_SEARCH_PATHS = (
"moonlight-common-c/enet/include",
"../libs/**",
"moonlight-common-c/nanors",
"moonlight-common-c/nanors/deps/obl",
);
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
MTL_ENABLE_DEBUG_INFO = NO;
@ -540,7 +554,7 @@
SDKROOT = appletvos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 12.0;
TVOS_DEPLOYMENT_TARGET = "$(RECOMMENDED_TVOS_DEPLOYMENT_TARGET)";
VALIDATE_PRODUCT = NO;
};
name = Release;
@ -606,6 +620,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SKIP_INSTALL = YES;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
};
name = Debug;
};
@ -666,6 +681,7 @@
PROVISIONING_PROFILE = "";
SDKROOT = macosx;
SKIP_INSTALL = YES;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
};
name = Release;
};
@ -676,9 +692,10 @@
EXECUTABLE_PREFIX = lib;
HEADER_SEARCH_PATHS = (
"moonlight-common-c/enet/include",
"../libs/**",
"moonlight-common-c/nanors",
"moonlight-common-c/nanors/deps/obl",
);
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = "$(RECOMMENDED_IPHONEOS_DEPLOYMENT_TARGET)";
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
ONLY_ACTIVE_ARCH = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
@ -694,9 +711,10 @@
EXECUTABLE_PREFIX = lib;
HEADER_SEARCH_PATHS = (
"moonlight-common-c/enet/include",
"../libs/**",
"moonlight-common-c/nanors",
"moonlight-common-c/nanors/deps/obl",
);
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = "$(RECOMMENDED_IPHONEOS_DEPLOYMENT_TARGET)";
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
ONLY_ACTIVE_ARCH = NO;
PRODUCT_NAME = "$(TARGET_NAME)";