Sample Chrome Debug Protocol proxy used to extend vscode-js-debug
Перейти к файлу
Connor Peet db8613874e
Merge pull request #8 from microsoft/dependabot/npm_and_yarn/decode-uri-component-0.2.2
chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2
2022-12-07 14:15:49 -08:00
src chore: update deps 2021-10-19 15:01:12 -07:00
.gitignore Initial commit 2020-02-11 02:09:52 +00:00
.npmignore chore: prep for publish 2020-02-11 08:41:17 -08:00
CODE_OF_CONDUCT.md chore: update deps 2021-10-19 15:01:12 -07:00
LICENSE Initial LICENSE commit 2020-02-10 18:09:56 -08:00
README.md chore: update deps 2021-10-19 15:01:12 -07:00
SECURITY.md chore: update deps 2021-10-19 15:01:12 -07:00
demo.js fix: remove need for hardcoding inspect uri 2020-02-27 10:26:12 -08:00
example.dot init 2020-02-10 20:33:04 -08:00
example.png init 2020-02-10 20:33:04 -08:00
package.json 0.2.1 2021-10-19 15:01:37 -07:00
tsconfig.json init 2020-02-10 20:33:04 -08:00
yarn.lock chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 2022-12-07 22:08:36 +00:00

README.md

vscode-cdp-proxy

Sample Chrome Debug Protocol proxy used to extend vscode-js-debug with custom targets. This can be used to allow js-debug to work with esoteric targets, like WebAssembly-compiled and frameworks like React Native. Say you're building a React Native debugger. The general flow would work like so:

  1. You have a React Native extension, which allows users to start debugging via a command or a launch config.

  2. When a session starts, you start a CDP proxy, like the one in this repo. Say it starts listening on localhost:3000

  3. Then, you call vscode.debug.startDebugger with a configuration like:

    {
      "type": "pwa-chrome",
      "request": "attach",
      "address": "localhost",  // <- host your proxy is running on
      "port": 3000,            // <- port your proxy is running on
    }
    
  4. The debugger will then connect to the proxy like it would any other CDP-enabled target.

  5. Finally, you translate between CDP and the protocol used to debug your target application. In the case of React Native, this is might be a minimal rewrite of some CDP behavior. In the case of more advanced WebAssembly targets, you might translate into something entirely new.

Using this Package

Parts of this package are exported from js-debug. We may publish these parts as nicely packaged bits for reuse here and in the extension, but that's not done right now.

Check out demo.js for an example of a server.