{"id":17444366,"url":"https://github.com/jameskyburz/sandbox-debugger","last_synced_at":"2026-03-05T22:03:10.578Z","repository":{"id":33165646,"uuid":"153801819","full_name":"JamesKyburz/sandbox-debugger","owner":"JamesKyburz","description":"sandbox debugger for node","archived":false,"fork":false,"pushed_at":"2024-02-09T16:00:03.000Z","size":799,"stargazers_count":11,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-21T18:04:47.989Z","etag":null,"topics":["ci-cd-pipeline","debug","docker","inspect","lambda","node","node-inspect","sandbox"],"latest_commit_sha":null,"homepage":"https://github.com/JamesKyburz/sandbox-debugger","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamesKyburz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-19T15:09:56.000Z","updated_at":"2024-11-21T14:22:52.000Z","dependencies_parsed_at":"2024-10-20T15:43:26.600Z","dependency_job_id":null,"html_url":"https://github.com/JamesKyburz/sandbox-debugger","commit_stats":{"total_commits":291,"total_committers":4,"mean_commits":72.75,"dds":0.4639175257731959,"last_synced_commit":"6330d5e54f5ee6290b75edd4d4b1b3c9953915ca"},"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesKyburz%2Fsandbox-debugger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesKyburz%2Fsandbox-debugger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesKyburz%2Fsandbox-debugger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesKyburz%2Fsandbox-debugger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesKyburz","download_url":"https://codeload.github.com/JamesKyburz/sandbox-debugger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251667230,"owners_count":21624453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci-cd-pipeline","debug","docker","inspect","lambda","node","node-inspect","sandbox"],"created_at":"2024-10-17T17:18:56.750Z","updated_at":"2026-03-05T22:03:10.520Z","avatar_url":"https://github.com/JamesKyburz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐛 sandbox-debugger 🐛\n\n[![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/feross/standard)\n\nDebug a [Node.js](https://nodejs.org) process anywhere using `chrome://inspect` or `node-inspect`\n\n| node debug port 9229 | ⟷ | sandbox debug client | ⟷ | sandbox debug broker |\n| :--                  | :-:  | --:                  | --:  | --:                  |\n\nInteractive debugging using [inspect](https://nodejs.org/de/docs/guides/debugging-getting-started/), debug the same way you do with a local process.\n\nSupports a [Node.js](https://nodejs.org) process running\n\n- [x] on a machine you can't ssh / don't have access to\n- [x] in a Docker Container with no exposed ports\n- [x] on [Travis CI](https://travis-ci.com/)\n- [x] on [Github Actions](https://github.com/features/actions)\n- [x] on [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines)\n- [x] on [GitLab CI/CD](https://about.gitlab.com/stages-devops-lifecycle/continuous-integration/)\n- [x] on [AWS CodeBuild](https://aws.amazon.com/codebuild/)\n- [x] on [AWS Lambda](https://aws.amazon.com/lambda/)\n- [x] on [Heroku](https://www.heroku.com/)\n- [x] on [Runkit](https://npm.runkit.com/)\n- [x] anywhere that allows outbound internet traffic to port 80\n\nHow it works?\n\nNode opens a websocket when in debug mode, both the sandbox server and client work by piping the websocket data via the broker.\n\n## Run sandbox server\n\nThe server is used as a gatekeeper for the debug messages.\n\n```sh\nnpx sandbox-debugger-server\n```\n\nor\n\n```sh\nᐅ docker run \\\n  --name sandbox-debugger \\\n  -ti \\\n  --rm \\\n  -p 9229:9229 \\\n  jameskyburz/sandbox-debugger\n```\n\nThe server will output\n\n```sh\n   Debug server started!                       \n                                               \n    - To debug a new process:                  \n      export DEBUG_PROXY=xxx.xxx.x.xxx:9229    \n      node index.js                            \n\n    - To debug an existing process:            \n      export DEBUG_PROXY=xxx.xxx.x.xxx:9229    \n      export DEBUG_PID=\u003cpid of node process\u003e   \n      npx sandbox-debugger                     \n\n    - Find pid of first running Node.js process\n      ps ax |\n      grep 'no[d]e ' |\n      awk '{print $1}' |\n      head -n 1\n\n    - Allow remote access to me:              \n      npx ngrok http 9229 --scheme http\n```\n\n## Create a tunnel to our sandbox server process\n\nUsing [ngrok](https://npm.im/ngrok) you can tunnel to the locally running broker from for example aws lambda.\n\n```sh\nnpx ngrok http 9229 --scheme http\n```\n\n# Client \n\n## Example debug current process\n\n```javascript\n// index.js\nrequire('sandbox-debugger')\ndebugger\nconsole.log('all done')\n```\n\n\u003ca href=\"https://asciinema.org/a/291811?autoplay=1\u0026speed=2\u0026size=small\u0026preload=1\"\u003e\u003cimg src=\"https://asciinema.org/a/291811.png\" width=\"100%\"/\u003e\u003c/a\u003e\n\n```sh\n# DEBUG_PROXY is ip:port to sandbox broker\nDEBUG_PROXY=ip:port node index.js\n```\n\n## Example debug an already running process\n\n```sh\n# DEBUG_PROXY is ip:port to sandbox broker\n# DEBUG_PID is pid of process to debug\nDEBUG_PROXY=ip:port DEBUG_PID=x npx sandbox-debugger\n```\n\n\u003ca href=\"https://asciinema.org/a/291814?autoplay=1\u0026speed=2\u0026size=small\u0026preload=1\"\u003e\u003cimg src=\"https://asciinema.org/a/291814.png\" width=\"100%\"/\u003e\u003c/a\u003e\n\n## AWS Lambda\n\nEnvironment variable `DEBUG_PROXY` needs to point to the `ngrok` address including the port part `:80`.\n\nThe easiest way to debug lambda is to edit the code in aws console.\n\nCopy the contents of `https://unpkg.com/sandbox-debugger@latest/dist/index.js` to debug.js, and `require('./debug.cjs')` instead of `sandbox-debugger`\n\nESM example\n```js\n  import { createRequire } from 'node:module'\n  const require = createRequire(import.meta.url)\n  require('./debug.cjs')\n```\n\n# license\n\n[Apache License, Version 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjameskyburz%2Fsandbox-debugger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjameskyburz%2Fsandbox-debugger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjameskyburz%2Fsandbox-debugger/lists"}