Remote debug server

I have made some progress on this now, so I’m going to outline the steps for my own future reference and for any other poor soul that attempts to remote debug rocket chat. Both my client and host machines are running Ubuntu 18.04. I cloned the rocket chat source from git into /home/remote_user/workspace/rocketchat.

i) start the rocket chat application on the remote server in debug mode
meteor npm run debug

ii) forward port 9229 on the client machine to the remote host via ssh
(by default node.js binds to port 9229 for debugging)
ssh -L 9229:127.0.0.1:9229 remote_user@remote_server_ip

iii) mount an NFS folder share between the client and host machines
sudo mount remote_server_ip:/home/remote_user/workspace /nfs/workspace

iv) start vscode on the client and open folder /nfs/workspace/rocketchat

v) open file launch.json in vscode and add localRoot, remoteRoot to the configuration (attach to meteor debug)
{
“name”: “Attach to meteor debug”,
“type”: “node”,
“request”: “attach”,
“port”: 9229,
“address”: “localhost”,
“restart”: false,
“sourceMaps”: true,
“sourceMapPathOverrides”: {
“meteor://:computer:app/": "{workspaceFolder}/*", "meteor://💻app/packages/rocketchat:*": "{workspaceFolder}/packages/rocketchat-”,
“meteor://:computer:app/packages/chatpal:": "{workspaceFolder}/packages/chatpal-*", "meteor://💻app/packages/assistify:*": "{workspaceFolder}/packages/assistify-
},
“localRoot”: “${workspaceFolder}”,
“remoteRoot”: “/nfs/workspace/rocketchat”,
“protocol”: “inspector”
}

vi) start the vscode node.js debugger