Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

tmm1
Copy link
Contributor

@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.

@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
Contributor 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 recently 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
Contributor 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
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Chengzhong Wu <cwu631@bloomberg.net>
Date: Wed, 5 Feb 2025 18:03:57 +0000
Subject: inspector: add Network.Initiator in inspector protocol
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This patch landed in node v22.15.0, so it will be unnecessary when that dependency is bumped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this patch here, since it will get pulled in later. That makes this PR much simpler and easier to backport.

@tmm1 tmm1 force-pushed the tmm1/network-inspect branch from 4ef9f04 to 476d2cb Compare May 6, 2025 05:41
@tmm1
Copy link
Contributor Author

tmm1 commented May 7, 2025

Not sure why the builds here keep timing out?

I can rebase to the latest main branch.

@tmm1 tmm1 force-pushed the tmm1/network-inspect branch from 476d2cb to 512e6fd Compare May 7, 2025 19:36
Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

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

API LGTM

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.

API LGTM

@jkleinsc jkleinsc merged commit 376634c into electron:main May 9, 2025
59 checks passed
@release-clerk
Copy link

release-clerk bot commented May 9, 2025

Release Notes Persisted

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

@trop
Copy link
Contributor

trop bot commented May 9, 2025

I have automatically backported this PR to "35-x-y", please check out #47029

@trop trop bot added the in-flight/35-x-y label May 9, 2025
@trop
Copy link
Contributor

trop bot commented May 9, 2025

I have automatically backported this PR to "36-x-y", please check out #47030

@trop trop bot removed the target/35-x-y PR should also be added to the "35-x-y" branch. label May 9, 2025
@trop
Copy link
Contributor

trop bot commented May 9, 2025

I have automatically backported this PR to "37-x-y", please check out #47031

@trop trop bot added in-flight/36-x-y in-flight/37-x-y merged/37-x-y PR was merged to the "37-x-y" branch. merged/36-x-y PR was merged to the "36-x-y" branch. merged/35-x-y PR was merged to the "35-x-y" branch. and removed 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. in-flight/37-x-y in-flight/36-x-y in-flight/35-x-y labels May 9, 2025
kigh-ota pushed a commit to kigh-ota/electron that referenced this pull request Sep 30, 2025
…6690)

* feat: add support for `--experimental-network-inspection`

* docs: fix minor formatting issues

visible on both GH[1] and the docs site[2]

[1] https://github.com/electron/electron/blob/main/docs/api/command-line-switches.md#nodejs-flags
[2] https://www.electronjs.org/docs/latest/api/command-line-switches#--inspect-brkhostport

* docs: add entry for new nodejs flag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review/approved ✅ merged/35-x-y PR was merged to the "35-x-y" branch. merged/36-x-y PR was merged to the "36-x-y" branch. merged/37-x-y PR was merged to the "37-x-y" branch. semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.