Skip to content

feat: add support for --experimental-network-inspection #46690

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tmm1
Copy link

@tmm1 tmm1 commented Apr 20, 2025

Description of Change

Allow --experimental-network-inspection to be used in NODE_OPTIONS.

Includes nodejs/node#56805

cc @deepak1556

Checklist

Release Notes

Notes: Added support for node option --experimental-network-inspection

@tmm1 tmm1 requested a review from a team as a code owner April 20, 2025 02:16
Copy link

welcome bot commented Apr 20, 2025

💖 Thanks for opening this pull request! 💖

Semantic PR titles

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Commit signing

This repo enforces commit signatures for all incoming PRs.
To sign your commits, see GitHub's documentation on Telling Git about your signing key.

PR tips

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Apr 20, 2025
@trop
Copy link
Contributor

trop bot commented Apr 20, 2025

@tmm1 has manually backported this PR to "34-x-y", please check out #46691

Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically approving the concept of this from a security standpoint given the fuse implication, this is correctly gated behind the debug fuse and as such doesn't expose substantially more surface area IMO.

@trop trop bot removed the in-flight/34-x-y label Apr 20, 2025
@tmm1
Copy link
Author

tmm1 commented Apr 21, 2025

Was able to build this locally and confirm it works.

// main.ts
const child = utilityProcess.fork(forkPath, [], {
  execArgv: ['--experimental-network-inspection']
})
// fork.ts
import https from 'node:https';

setInterval(function() {
  https.get('https://encrypted.google.com/', (res) => {
    console.log('statusCode:', res.statusCode);
    console.log('headers:', res.headers);
  }).on('error', (e) => {
    console.error(e);
  });
}, 5000)
Screenshot 2025-04-20 at 5 26 54 PM

response bodies are not visible, but request call stacks works.

@deepak1556 deepak1556 added semver/minor backwards-compatible functionality target/35-x-y PR should also be added to the "35-x-y" branch. target/36-x-y PR should also be added to the "36-x-y" branch. labels Apr 21, 2025
Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending build.

Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/electron/electron/blob/main/docs/api/command-line-switches.md#nodejs-flags should be updated to include the new flag --experimental-network-inspection

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Apr 27, 2025
Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tmm1 looks good, but you need to sign your commits before we can merge this:
This repo enforces commit signatures for all incoming PRs.
To sign your commits, see GitHub's documentation on Telling Git about your signing key.

@tmm1 tmm1 force-pushed the tmm1/network-inspect branch from f054a1a to 4ef9f04 Compare April 29, 2025 15:40
@tmm1
Copy link
Author

tmm1 commented Apr 29, 2025

@tmm1 looks good, but you need to sign your commits before we can merge this:

Sorry, I think I fixed it.

@github-actions github-actions bot added the target/37-x-y PR should also be added to the "37-x-y" branch. label Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review/requested 🗳 semver/minor backwards-compatible functionality target/35-x-y PR should also be added to the "35-x-y" branch. target/36-x-y PR should also be added to the "36-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants