Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the port debug is not working #272

Closed
p3x-robot opened this issue Sep 22, 2017 · 5 comments
Closed

the port debug is not working #272

p3x-robot opened this issue Sep 22, 2017 · 5 comments

Comments

@p3x-robot
Copy link

Ciao!
How are you?

Component Version
Operating system Linux server 4.12.0-1-amd64 #1 SMP Debian 4.12.6-1 (2017-08-12) x86_64 GNU/Linux
Node.js v8.5.0
Chrome/Chromium/... /opt/google/chrome/chrome --remote-debugging-port=32231 --headless --disable-gpu --enable-logging --log-level=0 --user-data-dir=/var/p3x/server.patrikx3.com/cache/chrome --user-agent="corifeus-server-renderer" about:blank

| chrome-remote-interface | latest in npm

Is Chrome running in a container? YES / NO

I execute Chrome, like this:
/opt/google/chrome/chrome --remote-debugging-port=32231 --headless --disable-gpu --enable-logging --log-level=0 --user-data-dir=/var/p3x/server.patrikx3.com/cache/chrome --user-agent="corifeus-server-renderer" about:blank

But I get this error:

 { Error: connect ECONNREFUSED 127.0.0.1:9222
    at Object._errnoException (util.js:1026:11)
    at _exceptionWithHostPort (util.js:1049:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1174:14)
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 9222 }

I did not change anything, but now suddenly (I automatic update with npm-check-updates so it is possible I updated this npm). I get this error. Why is it trying to looking for 9222 when I specified the port and I can telnet in with the port as well.

Do you have an idea why it is happening?

Patrik

@cyrus-and
Copy link
Owner

But I get this error:

Doing what?

Show me the command or the code that you're using.

@p3x-robot
Copy link
Author

            const client = await CDP({
//                port: port,
                target: `ws://localhost:${port}/devtools/browser`
            });

The port is the port I am using, why do is it .
Ok, I added in the port , removed the // port : port, now it works.

Sorry, so now the port in CDP is required, before it was working.
Weird.
Ciao! Thanks!

@p3x-robot
Copy link
Author

So now I have to use the target or the port? What is the different? I just have no idea, you know what is happening with the target and the port on the CDP options?

@cyrus-and
Copy link
Owner

cyrus-and commented Sep 22, 2017

The port is not required, it just defaults to 9222.

I just have no idea

Does this give you a clue?

@p3x-robot
Copy link
Author

yeah, i use both since they are the same otherwise its not working, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants