I am using a Debian VM on Google Cloud working as an API provider.
I access the API from Android on tcp port 30300 and it works OK.
I also access the API from a C++ App running on microcontrollers and it also works OK.
Then I decided to also provide the means to access the API from PHP and it is not working.
From an external server running Apache the API behaves as if it is not acessible, the API monitor does not show any access at all.
Then I moved the PHP script to the same server running the API and just changed the target server from its web address to http://127.0.0.1:30300/alprbr and it works OK.
The I checked the Compute Engine firewall rules closely and found the rule only allows for IPV6 and I found no way to allow trafic on the public IP address for IPV4.
I don't really know if this is the cause of the problem but seems something to be sorted out before trying something else.
Google Cloud Firewall Rule:
alprbr
Input
Apply to all
IP range: 0.0.0.0/0
tcp:30300
Allow
1000
default
netstat -an | grep "LISTEN"
returns:
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1880 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 :::30300 :::* LISTEN
What Am I doing wrong?
Assistance welcome.