Introduction
This article is defining on how to add port forwarding rule to access a NodeJS service. The NodeJS service is running in a guest machine. That guest machine is actually a virtual server running in VirtualBox application. Inside the virtual server, there will be a NodeJS service running with a specific port. Accessing the NodeJS service will be possible after running a NodeJS service using HTTP protocol in a specific port. For instance, the port for accepting the NodeJS service is 3001.
Step for Adding Port Forwarding Rule to Access NodeJS Service
So, the following are the steps to achieve it :
1. Access the VirtualBox Application as in the following image :
- Access the setting of the virtual server. Just right click on the virtual server and select the setting then the following dialog box will appear :
- Right after that, select the Network tab and the following image will appear :
- Click the Port Forwarding button to add another new rule for forwarding request from host machine to the guest machine. In this context, it is the NodeJS service request. Following on the appear of the Port Forwarding Rules window, just click the plus sign to add a new rule as in the following image :
After successfully editing according to the rule, it will exist as in the following image will appear :
The last line in the above port is just an example where in this context it is using 3001. It represent the NodeJS service port forwarding rule. Basically, the number can be vary depend on the choice of the port number.