Created
January 5, 2020 23:09
-
-
Save cocodrino/a8e8703b8caa99e6689bb2ef3e847581 to your computer and use it in GitHub Desktop.
remote debug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
si se desea activar de manera segura el debugger de node se debe seguir los siguientes pasos | |
1. corra el script con el argumento inspect-brk | |
``` | |
pm2 start ./server/server.js --node-args="--inspect-brk" --name api-test | |
``` | |
luego, *NO* abra puertos, esto es inseguro y cualquiera con acceso a su ip y puerto tendría acceso al código, para conectar la máquina local lo mejor es usar un ssh tunneling | |
https://nodejs.org/en/docs/guides/debugging-getting-started/#enabling-remote-debugging-scenarios | |
``` | |
ssh -L 9221:localhost:9229 -i tests.pem root@ip | |
``` | |
ahora simplemente activa el debugger en su máquina escuchando localhost y el puerto 9221 | |
**UNA VEZ TERMINE DE HACER DEBBUG REINICIE EL PROCESO SIN EL DEBBUGER, NO LO DEJE ACTIVO** | |
:sunglasses: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment