Skip to content

qbee-connect user defined port

In short

qbee-connect automatically selects a free port on the local system when establishing a connection to the remote device with specified remote port. This port is saved and reused on future connections (if the port is still available). However, if a specific local port is required we can apply this setting via our API.

The process consists essentially of three steps:

  • get an authentication token via API
  • get the Devices tab in the qbee platform and copy the device id of the desired device
  • provide the authentication token, the device id and the desired port mappings to the patch API

We show how to perform the respective steps

1. Authentication token

First of all, you need to generate an authentication token in the API as we explained here.

2. Device ID

Go to the Devices tab on the qbee platform and select the desired device in the group tree. Then, scroll down to the section qbee info and copy the device id field

!qbee device id

3. qbee-connect API

Go to the qbee-connect portmap API and select the PATCH field. There, provide the information from above. The field remote_port is the port on the remote device to be mapped and the field local_port is the local port that you want to map the remote_port to. Click on "Try!" and when establishing the connection within qbee-connect to the specified device and remote port you should get the desired local port.

!qbee-connect portmap API

Use of PATCH

You can only use the PATCH API if a connection has been established before. You'll get an error if you try to modify a non-existing port mapping. Therefore, you need to run qbee-connect, connect the port and receive a random port number which is assigned. Then you can patch the port to the one you want. If no connection has been established before you need to use the POST API.