2013-10-23 26 views
4

我在這裏跟着指示:我的PhantomJS遠程調試嘗試有什麼問題?

https://github.com/ariya/phantomjs/wiki/Troubleshooting

我也看到了所以在這裏:

Getting remote debugging set up with PhantomJS

但我不能爲我的生命得到遠程調試與PhantomJS一起工作。以下是我已經試過:

[ubuntu:phantom]$ phantomjs --version 
1.9.1 
[ubuntu:phantom]$ phantomjs --remote-debugger-port=9001 test.js & 
[1] 14037 
[ubuntu:phantom]$ sudo netstat -pntl 
Active Internet connections (only servers) 
Proto Recv-Q Send-Q Local Address   Foreign Address   State  PID/Program name 
tcp  0  0 0.0.0.0:9418   0.0.0.0:*    LISTEN  1075/git-daemon 
tcp  0  0 127.0.0.1:5038   0.0.0.0:*    LISTEN  1466/asterisk 
tcp  0  0 0.0.0.0:80    0.0.0.0:*    LISTEN  1629/apache2  
tcp  0  0 0.0.0.0:2000   0.0.0.0:*    LISTEN  1466/asterisk 
tcp  0  0 127.0.0.1:53   0.0.0.0:*    LISTEN  1089/dnsmasq  
tcp  0  0 127.0.0.1:631   0.0.0.0:*    LISTEN  968/cupsd  
tcp  0  0 127.0.0.1:5984   0.0.0.0:*    LISTEN  1363/beam.smp 
tcp6  0  0 :::9418     :::*     LISTEN  1075/git-daemon 
tcp6  0  0 ::1:631     :::*     LISTEN  968/cupsd  
[ubuntu:phantom]$ google-chrome localhost:9001 
Created new window in existing browser session. 
[ubuntu:phantom]$ 
[ubuntu:phantom]$ nc localhost 9001 

以上(不出所料)打開Chrome瀏覽器與Oops! Google Chrome could not connect to localhost:9001。我不應該在9001上看到一個開放的端口嗎?從我可以收集的內容來看,Chrome應該連接到一個(可能)空白頁面,我只需在JS控制檯上運行__run()即可。但就目前而言,沒有任何東西可以打開......我甚至不能對它進行淨化。

+0

您是否找到解決此問題的解決方案?我很喜歡同樣的 – Joakim

+0

我得到了完全相同的結果,但是在Windows 10中使用PJS 2.1.1 - netstat -abno不會在指定端口上收聽任何內容 –

回答

0

運行phantomjs,因爲sudo似乎有竅門