I've got an Ubuntu virtual machine on Azure. I added an enpoint in the azure management portal:
NAME PROTOCOL PUBLIC PORT PRIVATE PORT LOAD-BALANCED SET
---------------------------------------------------------------
HTTP TCP 80 80 -
And I tried to listen to it:
var http = require('http');
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hello World\n");
});
server.listen(80);
It works if I ssh in and curl it:
$ curl localhost:80
Hello World
But if I try to access it by subdomain.cloudapp.net
, nothing comes back. It also doesn't return anything when accessed by public ip address.
Which port and address should I listen on with my node application to access it from the outside world?
Do I need another azure service to be able to access the VM?
How would I enable public access if it's a problem with the firewall?
Edit:
I checked if there was a firewall, but there isn't:
$ sudo ufw status
[out :: subdomain.cloudapp.net] Status: inactive
Edit 2:
Provisioned a different ubuntu vm, but it still doesn't work. Tried to restart iptables, but no service was known:
$ sudo service iptables restart
iptables: unrecognized service
The iptables are:
$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:bootpc
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination