Port forwarding to run web services

Read time: 4 minutes

Q Blocks instances offer support for running web services with public access. This is enabled through port forwarding.

A web service can be forwarded at an open port of the Q Blocks instance and then accessed publicly.

๐Ÿ” Due to security reasons, all ports are not open. Only some random ports can be opened.

The pre-configured open ports of your instance can be viewed as follows:

  1. Go to your Active Instances Page.

  2. Click on the dropdown icon on your instance row to view instance info.

  3. Extra Ports section displays the open port as seen below:

๐Ÿ—’๏ธ Copy the Extra port and Host values

Example of a web service:

As an example, let us run Tensorboard web service in our instance. Tensorboard is a Machine learning experiment tracking software that can be launched as a web service and then accessed in your browser.

Run the following commands in your instanceโ€™s terminal:

pip install tensorboard
tensorboardย --logdir LOG_FOLDER --host=0.0.0.0 --port EXTRA_PORT

Replace EXTRA_PORT with the Port number copied above.

This should launch the service and it should be accessible at the following URL:

http://HOST:EXTRA_PORT

The same way, you can launch any web service in your instance at a provided port.

Please see:

Any application running at a forwarded port is accessible to the public. Right precautions with auth token or password access must be implemented to secure the applications.

If you still face issues setting it up then don't hesitate to reach out to us at: support@qblocks.cloud

Last updated