What is wrong with my attempt to remotely debug PhantomJS?

I followed the instructions below:

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

And I saw SO here:

Getting remote debugging using PhantomJS

But I can’t get my life removed by remote debugging using PhantomJS. Here is what I tried:

[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

The above (unsurprisingly) opening Chrome with Oops! Google Chrome could not connect to localhost:9001. Shouldn't I see the open port on 9001? From what I can assemble, Chrome should connect to a (possibly) blank page that I just run __run()on the JS console. But, since it costs, nothing opens ... I cannot even netcat to it.

+4
source share
1

phantomjs sudo, ,

0

All Articles