When developing web apps, testing across multiple devices is vital to ensure that what you’re building will work for you users. ChromeOS’s built-in port forwarding allows you to open the port to your local development server, allowing access from phones or other computers.
Start by going to the developer settings on ChromeOS and clicking the Linux box. There should be an option Port forwarding. Click on that.
This will open up the Port forwarding screen. When you set up ports to be forwarded, they’ll show up here. Click the Add button to forward a port.
When forwarding a port, you have three options: the port number to forward, the connection type, either TCP (default) or UDP, and if you want to label the port.
Once added, your ports will show up in the Port forwarding list, where you can toggle them on or off or remove them entirely.
The last thing you’ll need is the IP address of your host ChromeOS device. In “Settings”, go to “Network” and select the network your device is on. You’ll be able to see the IP address here. This IP address, combined with the port you forwarded, will allow any device on the same network to connect to the server on that port. On your other device, you can access the server at this address:
<host device IP address>:<port>.