Access devices using secure tunnels

Updated at:

Access clients can use secure tunnels from IoT Platform to remotely access and communicate with devices on a corporate intranet. This topic describes the complete workflow for using secure tunnels.

Background information

For more information about secure tunnels, see Secure tunnel overview.

Workflow

  1. Develop the device: Implement the secure tunnel feature on the device. Connect the device to IoT Platform and make sure it is activated and online.
  2. Add a secure tunnel for the device: Create a secure tunnel for the online device in IoT Platform. This provides the URL and token that the access client needs to connect to the tunnel.
    After the secure tunnel is created, IoT Platform sends a notification over the topic /sys/${YourProductKey}/${YourDeviceName}/secure_tunnel/notify. This notification instructs the device to establish a secure WebSocket channel with IoT Platform.
  3. Develop the access client: Develop an application on the access client and configure its features as follows to establish a secure WebSocket channel between the access client and IoT Platform.
    • The access client uses the WebSocket protocol and the client URL to establish a connection, and uses the HTTP request header for token authentication. Add the following information to the request header:
      • Authentication token: The request field is tunnel-access-token. The value is the access client token that you obtained in Step 2.
      • WebSocket connection protocol: The request field is subprotocol. The value is aliyun.iot.securetunnel-v1.1.
    • IoT Platform defines a communication protocol for secure tunnels. Encapsulate this protocol to enable communication between the access client and the device. For more information about the communication protocol, see Secure tunnel communication protocol.
  4. Remotely access the device: After both the device and the access client are connected to the secure tunnel, the access client can remotely access and communicate with the device.

Examples