Skip to content

Proxy browser requests in remote workspaces - #315843

Merged
Kyle Cutler (kycutler) merged 11 commits into
mainfrom
kycutler/remoteproxy2
Jun 9, 2026
Merged

Kyle Cutler (kycutler) merged 11 commits into
mainfrom
kycutler/remoteproxy2

Conversation

@kycutler

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 11, 2026 19:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for proxying integrated browser (Browser View) network requests through the remote connection when running in a remote workspace, implemented via a shared-process HTTPS proxy with certificate pinning and automatic proxy auth.

Changes:

  • Introduces a shared-process tunnel proxy (TLS + basic auth) and wires it into Browser View session creation/configuration.
  • Adds a remote-proxy enablement setting plus a Browser View URL-bar indicator for remote/proxy status.
  • Adds node-level test coverage for the proxy server and self-signed certificate generation.
Show a summary per file
File Description
src/vs/workbench/workbench.desktop.main.ts Registers the shared-process tunnel proxy service in the desktop workbench entrypoint.
src/vs/sessions/sessions.desktop.main.ts Registers the shared-process tunnel proxy service in the Sessions window entrypoint.
src/vs/workbench/contrib/browserView/electron-browser/media/browser.css Adds styling for pre-URL widgets and a remote connection indicator.
src/vs/workbench/contrib/browserView/electron-browser/features/browserTabManagementFeatures.ts Ensures localhost link opening uses the original source URI when remote proxying is enabled.
src/vs/workbench/contrib/browserView/electron-browser/features/browserRemoteFeatures.ts Adds the remote indicator contribution and workbench.browser.enableRemoteProxy setting registration.
src/vs/workbench/contrib/browserView/electron-browser/features/browserDataStorageFeatures.ts Adds 'default' as the new default for workbench.browser.dataStorage and updates enum descriptions.
src/vs/workbench/contrib/browserView/electron-browser/browserViewWorkbenchService.ts Starts/stops the tunnel proxy for remote authorities and passes proxy info in sessionOptions.
src/vs/workbench/contrib/browserView/electron-browser/browserView.contribution.ts Wires in the new remote Browser View features contribution.
src/vs/workbench/contrib/browserView/electron-browser/browserEditor.ts Adds preUrlWidgets extension point and renders contributed widgets before the URL input.
src/vs/workbench/contrib/browserView/common/browserView.ts Extends Browser View model/service contracts with willUseRemoteProxy() and isRemoteSession.
src/vs/workbench/contrib/browserView/browser/browserView.contribution.ts Implements willUseRemoteProxy() for web (non-electron) as always false.
src/vs/platform/tunnel/common/sharedProcessTunnelProxyService.ts Defines the shared-process tunnel proxy service contract and ITunnelProxyInfo.
src/vs/platform/tunnel/electron-browser/sharedProcessTunnelProxyService.ts Registers the shared-process remote service channel on the renderer side.
src/vs/platform/tunnel/node/sharedProcessTunnelProxyService.ts Implements a refcounted shared-process service that starts/stops TunnelProxy per authority.
src/vs/platform/tunnel/node/tunnelProxy.ts Implements the local-loopback TLS HTTPS proxy that forwards via remote-agent tunnels.
src/vs/platform/tunnel/node/selfSignedCert.ts Implements in-memory self-signed cert generation and fingerprinting.
src/vs/platform/tunnel/test/node/tunnelProxy.test.ts Adds unit tests for proxy auth, forwarding, CONNECT, pooling, and lifecycle behavior.
src/vs/platform/tunnel/test/node/selfSignedCert.test.ts Adds unit tests for the generated cert structure and fingerprint calculation.
src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts Instantiates and exposes the shared-process tunnel proxy service over IPC.
src/vs/platform/browserView/common/browserView.ts Updates Browser View IPC types to include sessionOptions and isRemoteSession.
src/vs/platform/browserView/electron-main/browserViewMainService.ts Passes sessionOptions into BrowserSession.getOrCreate(...).
src/vs/platform/browserView/electron-main/browserSession.ts Applies proxy config to Electron sessions via setProxy() when tunnel proxy is present.
src/vs/platform/browserView/electron-main/browserView.ts Auto-supplies tunnel proxy credentials on webContents login and exposes isRemoteSession in state.
src/vs/platform/browserView/electron-main/browserSessionTrust.ts Trusts the tunnel proxy’s self-signed certificate by fingerprint in the cert verify proc.
src/vs/platform/native/electron-main/auth.ts Avoids global proxy-auth prompting for Browser View webContents (intended to defer to per-webContents handling).

Copilot's findings

Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/browserView/electron-browser/features/browserRemoteFeatures.ts:70

  • The comment says the icon is "Always" displayed in remote workspaces, but the actual condition uses willUseRemoteProxy(), which is false in remote workspaces when workbench.browser.enableRemoteProxy is disabled. Either adjust the comment to reflect the setting gate, or change the condition if the intent is to show the indicator whenever remoteAuthority is present.
		// Always display the icon in remote workspaces -- just update the state based on whether we're actually serving via remote.
		this._container.style.display = isConnected || this.browserViewWorkbenchService.willUseRemoteProxy() ? '' : 'none';
	}
  • Files reviewed: 25/25 changed files
  • Comments generated: 4

@github-actions

github-actions Bot commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

Base: f9a9359d Current: dca8c326

No screenshot changes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 30/30 changed files
  • Comments generated: 7

@kycutler
Kyle Cutler (kycutler) marked this pull request as ready for review June 9, 2026 20:39
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Robo (@deepak1556)

Matched files:

  • src/vs/code/electron-main/app.ts
  • src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts

Joaquín Ruales (@jruales)

Matched files:

  • src/vs/platform/browserView/common/browserView.ts
  • src/vs/platform/browserView/electron-main/browserSession.ts
  • src/vs/platform/browserView/electron-main/browserSessionRemote.ts
  • src/vs/platform/browserView/electron-main/browserSessionTrust.ts
  • src/vs/platform/browserView/electron-main/browserView.ts
  • src/vs/platform/browserView/electron-main/browserViewGroup.ts
  • src/vs/platform/browserView/electron-main/browserViewMainService.ts
  • src/vs/platform/browserView/test/electron-main/browserSessionTrust.test.ts
  • src/vs/workbench/contrib/browserView/browser/browserView.contribution.ts
  • src/vs/workbench/contrib/browserView/common/browserView.ts
  • src/vs/workbench/contrib/browserView/electron-browser/browserView.contribution.ts
  • src/vs/workbench/contrib/browserView/electron-browser/browserViewWorkbenchService.ts
  • src/vs/workbench/contrib/browserView/electron-browser/features/browserDataStorageFeatures.ts
  • src/vs/workbench/contrib/browserView/electron-browser/features/browserEditorErrorFeatures.ts
  • src/vs/workbench/contrib/browserView/electron-browser/features/browserRemoteFeatures.ts
  • src/vs/workbench/contrib/browserView/electron-browser/features/browserTabManagementFeatures.ts
  • src/vs/workbench/contrib/browserView/electron-browser/media/browser.css
  • src/vs/workbench/contrib/browserView/electron-browser/widgets/browserUrlBarWidget.ts

@kycutler
Kyle Cutler (kycutler) merged commit 764b813 into main Jun 9, 2026
39 of 40 checks passed
@kycutler
Kyle Cutler (kycutler) deleted the kycutler/remoteproxy2 branch June 9, 2026 21:40
@vs-code-engineering vs-code-engineering Bot added this to the 1.125.0 milestone Jun 9, 2026
@kycutler Kyle Cutler (kycutler) linked an issue Jun 12, 2026 that may be closed by this pull request
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Jul 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run Integrated Browser in remote environment

3 participants