labbsr0x / convid-accounts-backend

Accounts microservice for Convid remote access solution. This microservice handles Accounts and Machine registrations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check colision for tunnelPort

tiagostutz opened this issue · comments

Currently, the tunnelPort attribute is just being assigned by a Math.random() function withou checking collision and not considering the provided port range by the environment var TUNNEL_PORT_RANGE. As this can lead to port collision, there are 2 things to be done:

  • Guarantee that the port is within the TUNNEL_PORT_RANGE

  • Guarantee that the port is not being already used by other machines. To do so, you can check the registered_machine collection that has registered the machineId and the respective tunnelPort

commented

@tiagostutz , can i take this issue? =]