Я следовал инструкциям здесь:
https://github.com/ariya/phantomjs/wiki/Troubleshooting
И я видел SO здесь:
Настройка удаленной отладки с помощью 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 должен подключиться к (возможно) пустой странице, на которой я просто запускаю __run()
в консоли JS. Но в нынешнем виде ничего не открывается... Я даже не могу подключиться к нему.