johntitus / node-horseman

Run PhantomJS from Node
MIT License
1.45k stars 124 forks source link

NetStat access / errors when opening page (Azure) - why needed? #314

Open hardcodet opened 7 years ago

hardcodet commented 7 years ago

I did a simple trial of Phantom in Azure Functions today, and then gave Horseman a try because it offers a nicer API. I was assuming those have the same requirements, but while my Phantom-only test worked just fine, Horseman crashes with this simple snippet:

var buf = horseman
    .open('http://www.google.com')
    .catch(function(err) {
        context.log("ERROR " + err);
    })
    .close();

The logged output was as follows: ERROR HeadlessError: Error executing command to extract phantom ports: Error: Command failed: netstat -ano | findstr /R "\<18580\>" Access is denied.

So I'm assuming Horseman wants to access stuff on the machine I'd rather not have it. Apart from me not being able to expose this on Azure: Is this really needed given that Phantom works just fine without it, or something that might be fixed?

thEpisode commented 7 years ago

Same error: ERROR HeadlessError: Error executing command to extract phantom ports: Error: Command failed: netstat -ano | findstr /R "\<18580>" Access is denied.

awlayton commented 7 years ago

node-phantom-simple uses netstat to figure out which port PhantomJS starts on.

thEpisode commented 7 years ago

And what is a solution?, my solution is create a new VM with linux and deploy a basic API 😢