Search code examples
ubuntugruntjsserverremote-serverkoding

Connect grunt instance from the web on remote vm


Hello I am running a grunt instance on a koding vm. I want to be able to connect to the grunt instance from the web so i can actually see my work.

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name Timer
tcp        0      0 0.0.0.0:9000            0.0.0.0:*               LISTEN      2685/grunt       off (0.00/0/0)

It seems I am listening on the port with the grunt server, but when I try to access:

http://ubkkc6631b3c.bogdanmaier.koding.io:9000

It returns ERR_CONNECTION_REFUSED

Any Idea why? Or how can i fix this?

Grunt.js:

...
 connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: '0.0.0.0',
        livereload: 35729
      },
...

EDIT:

From terminal

WGET http://ubkkc6631b3c.bogdanmaier.koding.io:9000

Result:

~/workspace/yeoman-tests-dev $ wget http://ubkkc6631b3c.bogdanmaier.koding.io:9000/
--2015-10-08 10:02:53--  http://ubkkc6631b3c.bogdanmaier.koding.io:9000/
Resolving ubkkc6631b3c.bogdanmaier.koding.io (ubkkc6631b3c.bogdanmaier.koding.io)... 52.30.48.227
Connecting to ubkkc6631b3c.bogdanmaier.koding.io (ubkkc6631b3c.bogdanmaier.koding.io)|52.30.48.22
7|:9000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3118 (3.0K) [text/html]
Saving to: 'index.html.3'

100%[=======================================================>] 3,118       --.-K/s   in 0.001s  

2015-10-08 10:02:54 (5.10 MB/s) - 'index.html.3' saved [3118/3118]

Solution

  • The configurations are correct. The reason for the this problem was the closed port in the network I was at that time. So consider testing with a different network if you think you got all the settings right. :)