在远程虚拟机上连接web上的grunt实例

时间:2015-10-08 08:04:06

标签: ubuntu gruntjs server remote-server koding

您好我正在koding vm上运行一个grunt实例。我希望能够从网络连接到grunt实例,这样我才能真正看到我的工作。

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)

似乎我正在使用grunt服务器监听端口,但是当我尝试访问时:

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

返回ERR_CONNECTION_REFUSED

任何想法为什么?或者我该如何解决这个问题?

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
      },
...

修改

从终端

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

结果:

~/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]

1 个答案:

答案 0 :(得分:0)

配置正确。出现这个问题的原因是我当时在网络中关闭了端口。因此,如果您认为所有设置都正确,请考虑使用其他网络进行测试。 :)