# relay **Repository Path**: marklewis/relay ## Basic Information - **Project Name**: relay - **Description**: USB - **Primary Language**: Objective-C - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-09-13 - **Last Updated**: 2026-09-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

Relay

Relay is a tool to tunnel iOS sockets to your local machine through a USB tunnel.

⚠️ This is an experimental project and might make your app crash. Do not use on production builds. 💕 Contributions are welcome and appreciated. ## How it works ### Client-side (iOS) Relay will create one or more sockets listening on an arbitrary, user-specified port. All the communication in that port will be forwarded to and from your computer through a USB connection. ### Server-side (macOS) When running on your machine, Relay will listen for connections over USB and route the client's traffic to and from localhost at the requested port. ## Installing ### Client-side (iOS) _If you'd rather install manually, check [ExampleRelayClient](https://github.com/igorlira/relay/blob/master/ExampleRelayClient) for an example._ Relay is available on CocoaPods. Add the following line on your Podfile: ```ruby pod 'RelayClient', '0.0.1-alpha1' ``` After running `pod install`, Add the following lines to your AppDelegate.m: ```diff +#import @interface AppDelegate () +@property (nonatomic, strong) RelayConnectionManager* relayManager; @end - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + self.relayManager = [[RelayConnectionManager alloc] init]; + // Use hangIfNotConnected to prevent incoming connections from being refused if we're not connected over USB + self.relayManager.hangIfNotConnected = YES; + // Will relay iOS(localhost:80) to macOS(localhost:8081) + [self.relayManager addLocalPort:@(80) relayPort:@(8081)]; + [self.relayManager start]; } - (void)applicationDidEnterBackground:(UIApplication *)application { + [self.relayManager stop]; } - (void)applicationWillEnterForeground:(UIApplication *)application { + [self.relayManager start]; } ``` ✅ Done! ### Server-side (macOS) You can either build the target `RelayServer` directly from the source code, or download a precompiled version [here](https://github.com/igorlira/relay/raw/master/RelayServer-macOS.dmg). Relay will add an icon to your menu bar indicating if it's connected to a device:

Relay menu

## Contributions All contributions are welcome and appreciated. Thank you!