我在我的Mac机上安装了Prerenderer IO(OS X Yosemite 10.10.3)。在安装之后,我运行sudo npm install
并运行sudo node server.js
以获得以下错误:
phantom stdout: XMLHttpRequest cannot load http://::1:12302/dnode/info. Cross origin requests are only supported for HTTP.
phantom stdout: XMLHttpRequest cannot load http://::1:12301/dnode/info. Cross origin requests are only supported for HTTP.
phantom stdout: NETWORK_ERR: XMLHttpRequest Exception 101: A network error occured in synchronous requests.
.../node_modules/phantom/shim.js:1815
.../node_modules/phantom/shim.js:1842
phantom stdout: NETWORK_ERR: XMLHttpRequest Exception 101: A network error occured in synchronous requests.
.../node_modules/phantom/shim.js:1815
.../node_modules/phantom/shim.js:1842
2015-08-04T13:45:47.307Z getting https://google.com
phantom stdout: XMLHttpRequest cannot load http://::1:12303/dnode/info. Cross origin requests are only supported for HTTP.
NETWORK_ERR: XMLHttpRequest Exception 101: A network error occured in synchronous requests.
.../node_modules/phantom/shim.js:1815
.../node_modules/phantom/shim.js:1842
phantom stdout: XMLHttpRequest cannot load http://::1:12304/dnode/info. Cross origin requests are only supported for HTTP.
phantom stdout: NETWORK_ERR: XMLHttpRequest Exception 101: A network error occured in synchronous requests.
.../node_modules/phantom/shim.js:1815
.../node_modules/phantom/shim.js:1842
我尝试输入网址http://localhost:3000/https://google.com
并在几分钟后挂断。
我已更改权限并尝试全局安装。两者都不起作用
答案 0 :(得分:0)
我遇到了同样的问题,并在第70行更改了此文件lib/server.js
,如下所示:
var args = ["--load-images=false", "--ignore-ssl-errors=true", "--ssl-protocol=tlsv1"];
到那个:
var args = ["--load-images=false", "--ignore-ssl-errors=true", "--ssl-protocol=tlsv1", "--web-security=no"];
现在您的NETWORK_ERROR应该消失。
有关更多信息,请参阅此stack或tihs github issue。