Access on the local network
Sometimes you need to run your CMA application in a mode where other users can access it to look at the development progress.

1. Get an IP address

Every device that is connected to the local is assigned an IP address in that network. Usually, this is done by the router. To get your IP address on the local network, use the following guide:
Ubuntu
Manjaro Linux
macOS
1
ifconfig -a
Copied!
1
ip -4 addr | grep 192.168
Copied!
1
ipconfig getifaddr en0
2
> 192.168.0.xxx
Copied!

2. Make port public

Each OS has a different approach to opening ports in its firewall.

Linux

We will be using UFW to control iptables rules.
Ubuntu
Manjaro Linux
1
# install it
2
sudo apt-get install ufw
3
4
# enable service
5
sudo ufw enable
6
7
# make sure that it is running
8
sudo ufw status verbose
9
10
# open port
11
sudo ufw allow in 80/tcp
12
13
# now we have port 80 available outside of our system
Copied!
1
# install it
2
pamac install ufw
3
4
# enable service
5
sudo systemctl enable ufw.service
6
sudo ufw enable
7
8
# open port
9
sudo ufw allow in 80/tcp
10
11
# now we have port 80 available outside of our system
Copied!

MacOS

Go to System Preferences > Security & Privacy > Firewall. Enable firewall. Then go to Firewall Options and make sure the only two options selected are Automatically allow built-in software to receive incoming connections and Automatically allow downloaded signed software to receive incoming connections.

3. Setup CMA

Add to your cma.js file field host with your IP address:
1
module.export = {
2
... other configuration
3
host: '192.168.0.100'
4
}
Copied!
That is it! Now your devices on the local network can communicate with your CMA instance!
You also need to apply changes by running the start command without -s option.
Last modified 8mo ago