0

您好,我正在 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]
4

1 回答 1

0

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

于 2015-10-09T10:32:32.400 回答