Skip to content

getditto/mobile-microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Mobile Microservices

Ever wondered what it would be like to run HTTP servers at the edge, but the HTTP servers were mobile apps themselves? Also, they could talk to each other even without an internet connection.

This project shows off how you can turn mobile apps like an iPhone on the local area network into a server. This concept broadly introduces how developers can think of mobile devices as more than mere client devices, but also as intelligent, cloud-optional servers. For more information on a more out-of-the box solution see the Ditto Platform

iOS

Usage

  1. Make sure your devices are on the same Local Area Network.
  2. Ensure that your Local Area Network does not have Client Isolation Mode turned on. Client isolation ON means that peer to peer discovery on the Local Area Network is not possible.
  3. Open up ios/MobileMicroservices.xcproj
  4. Swift Package Manager will begin downloading Vapor
  5. Run the app ideally on an iPhone or iPad. You can run it in the simulator, but only 1 at a time.

iOS Commentary

  • The HTTP Server is a Swift framework called Vapor
  • Service Discovery is handled via Apple's Network Framework's NWBrowser.
  • Note, NWBrowser does not have the ability to resolve a Hostname. NetServiceBrowser does but has been labeled as deprecated as of iOS 15.
  • This project is a proof of concept and isn't recommended without a more robust implementation. Host name resolution depends more on Apple's device name guidelines described here.
  • SwiftUI preview simulators will not start the NWBrowser services.

Android

Coming Soon!

Releases

No releases published

Packages

No packages published

Languages