For Developers


Custom URL Schemes in iOS

As per Apple's documentation, custom URL schemes provide a way to reference resources inside your app. For example, users tapping a custom URL in an email will launch your app in a specified context. Other apps can also trigger your app to launch with specific context data; for example, a photo library app might display a specified image.‌

Termius has the following supported schemes:‌

  • mosh://

  • telnet://

  • ssh://

  • sa://

  • serverauditor://

  • termius://

All these schemes do the same thing: create and/or connect to a host based on given parameters. The telnet and mosh schemes start a connection with the corresponding protocol, but all other schemes use SSH protocol.‌

Using Termius URL Schemes ‌

All schemes expect an URL following this pattern:‌

ssh://[string username]@[string hostname]:[int port number]

You may also provide an optional id parameter that will help Termius identify the host you may have previously passed to the app.‌

ssh://[string username]@[string hostname]:[int port number]?id=[int id]

Please note that if the parameters change for an existing host that has the same id parameter will be automatically updated.‌

If you open the following URL in your app via the openUrl: method, Termius will either suggest saving a new host or connecting to the new host:‌

ssh://[email protected]:22?id=420


External Intents

Termius can work with external intents.‌

Connecting to a Host

  • Create Intent

  • Set Intent Action

  • Add Intent Data to URI‌

Action: "android.intent.action.VIEW" URI: ssh://[email protected]:22

For example: Intent intent = new Intent(); intent.setAction("android.intent.action.VIEW"); intent.setData(uri);

Connecting with Password (optional)

Use the putExtra method to add an extra string to the intent:‌

intent.putExtra("com.serverauditor.password", "pass");

Group (optional - by default it's set to ConnectBot):

Use the putExtra method to add an extra string to the intent:‌

intent.putExtra("com.serverauditor.groupname", "group_name");