Skip to content

MobileBridge

Outgoing Messages

ProtectSocket

Protect a socket from VPN connections.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Publish",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "ProtectSocket"
        }
    },
    "payload": {
        "socket": {{Int}}        
    }
}

Payload

Property Type Required Description Example
socket Int Yes The socket to protect.

OnActiveTransportChange

Notify transport change.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Publish",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "OnActiveTransportChange"
        }
    },
    "payload": {
        "transportId": {{String}},
        "transportState": {{TransportState}}        
    }
}

Payload

Property Type Required Description Example
transportId String Yes The string to identify the transport.
transportState TransportState Yes The transport state

OnDeviceHandshaked

Notify a device has completed handshaking.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Publish",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "OnDeviceHandshaked"
        }
    },
    "payload": {
        "transportId": {{String}},
        "deviceToken": {{String}},
        "friendlyName": {{String}}        
    }
}

Payload

Property Type Required Description Example
transportId String Yes The string to identify the transport.
deviceToken String Yes An unique token to identify the device.
friendlyName String Yes Device's friendly name.

OnInfo

Notify an info sent from a connected device.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Publish",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "OnInfo"
        }
    },
    "payload": {
        "deviceToken": {{String}},
        "infoId": {{Int}},
        "info": {{String}}        
    }
}

Payload

Property Type Required Description Example
deviceToken String Yes An unique token to identify the device.
infoId Int Yes
info String Yes The info string.

GetTransports

Get the list of transports.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Publish",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "GetTransports"
        }
    }
}

Connect

Connect to the specified transport.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Publish",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "Connect"
        }
    },
    "payload": {
        "transportId": {{String}},
        "inputStreamId": {{String}},
        "outputStreamId": {{String}}        
    }
}

Payload

Property Type Required Description Example
transportId String Yes The string to identify the transport.
inputStreamId String Yes Stream ID of incoming transport data.
outputStreamId String Yes Stream ID of outgoing transport data.

Disconnect

Disconnect with specified transport.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Publish",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "Disconnect"
        }
    },
    "payload": {
        "transportId": {{String}}        
    }
}

Payload

Property Type Required Description Example
transportId String Yes The string to identify the transport.

Incoming Messages

StartMobileBridge

Start mobile bridge.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Publish",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "StartMobileBridge"
        }
    },
    "payload": {
        "tunFd": {{Int}}        
    }
}

Payload

Property Type Required Description Example
tunFd Int Yes The file descriptor for the TUN interface.

StopMobileBridge

Stop mobile bridge.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Publish",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "StopMobileBridge"
        }
    }
}

AuthorizeDevice

Notify a device has completed handshaking.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Publish",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "AuthorizeDevice"
        }
    },
    "payload": {
        "deviceToken": {{String}},
        "authorized": {{Bool}}        
    }
}

Payload

Property Type Required Description Example
deviceToken String Yes An unique token to identify the device.
authorized Bool Yes Whether the device is authorized.

SendInfo

Send an info to the specified device.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Publish",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "SendInfo"
        }
    },
    "payload": {
        "deviceToken": {{String}},
        "infoId": {{Int}},
        "info": {{String}}        
    }
}

Payload

Property Type Required Description Example
deviceToken String Yes An unique token to identify the device.
infoId Int Yes
info String Yes The info string.

ProtectSocketReply

Reply for ProtectSocket message.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Reply",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "ProtectSocket",
            "replyToId": {{String}}        
        }
    },
    "payload": {
        "success": {{Bool}}        
    }
}

Payload

Property Type Required Description Example
success Bool Yes Success to protect the socket.

GetTransportsReply

Reply for GetTransports message.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Reply",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "GetTransports",
            "replyToId": {{String}}        
        }
    },
    "payload": {
        "transports": [{{Transport}}]        
    }
}

Payload

Property Type Required Description Example
transports Transport[] Yes The list of transports.

ConnectReply

Reply for Connect message.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Reply",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "Connect",
            "replyToId": {{String}}        
        }
    },
    "payload": {
        "transportId": {{String}},
        "success": {{Bool}}        
    }
}

Payload

Property Type Required Description Example
transportId String Yes The string to identify the transport.
success Bool Yes Success of connection attempt.

DisconnectReply

Reply for Disconnect message.

JSON Structure

{
    "header": {
        "version": "4.0",
        "messageType": "Reply",
        "id": {{String}},
        "messageDescription": {
            "topic": "MobileBridge",
            "action": "Disconnect",
            "replyToId": {{String}}        
        }
    },
    "payload": {
        "transportId": {{String}},
        "success": {{Bool}}        
    }
}

Payload

Property Type Required Description Example
transportId String Yes The string to identify the transport.
success Bool Yes Success of disconnection attempt.

Type Definitions

App

JSON Structure

{
    "appId": {{String}}        
}

Properties

Property Type Required Description Example
appId String Yes The unique identifier of the app.

Transport

JSON Structure

{
    "transportId": {{String}},
    "type": {{TransportType}}        
}

Properties

Property Type Required Description Example
transportId String Yes The unique identifier of the transport.
type TransportType Yes The transport type.

Enums

TransportType

Values

Value Description
"BLUETOOTH"
"WIFI"
"USB"
"EAP"
"UNKNOWN"

TransportState

Values

Value Description
"INITIALIZED"
"CONNECTING"
"CONNECTED"
"HANDSHAKED"
"AUTHORIZED"
"DISCONNECTED"