<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Electron on Margrop Blog</title>
    <link>https://blog.margrop.net/en/tag/electron/</link>
    <description>Recent content in Electron on Margrop Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <lastBuildDate>Wed, 25 Mar 2026 10:00:00 +0800</lastBuildDate>
    <atom:link href="https://blog.margrop.net/en/tag/electron/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Adding Proxy Support to Antigravity and Claude on macOS: Safely Wrapping Electron Apps Without Patching Them</title>
      <link>https://blog.margrop.net/en/post/macos-electron-app-proxy-wrapper-for-antigravity-and-claude/</link>
      <pubDate>Wed, 25 Mar 2026 10:00:00 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/macos-electron-app-proxy-wrapper-for-antigravity-and-claude/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Before You Start&lt;/strong&gt;&#xA;This post documents a pattern that has already been validated in a real macOS environment: &lt;strong&gt;do not patch the original application bundle, and do not publish your real proxy endpoint. Instead, place a tiny wrapper app in front of the original Electron application.&lt;/strong&gt; That wrapper becomes the stable place where proxy settings, launch flags, and Node-side bootstrap logic live.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;When people first hit this problem, the instinct is usually to edit &lt;code&gt;/Applications/Claude.app&lt;/code&gt; or &lt;code&gt;/Applications/Antigravity.app&lt;/code&gt; directly. That can work once, but it is a poor long-term operational choice for three reasons:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You may break code signing behavior and make future launches or permission prompts more fragile.&lt;/li&gt;&#xA;&lt;li&gt;Auto-updates can overwrite your local modifications at any time.&lt;/li&gt;&#xA;&lt;li&gt;If you hardcode a real proxy endpoint into the app bundle, screenshots, scripts, or a public post, you can leak private infrastructure details that never needed to be exposed.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The approach that proved much more stable was:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Leave the original &lt;code&gt;Claude.app&lt;/code&gt; and &lt;code&gt;Antigravity.app&lt;/code&gt; untouched.&lt;/li&gt;&#xA;&lt;li&gt;Create &lt;code&gt;Claude (Proxy).app&lt;/code&gt; and &lt;code&gt;Antigravity (Proxy).app&lt;/code&gt; under &lt;code&gt;~/Applications&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Let each wrapper app do only three things: load a private &lt;code&gt;proxy.env&lt;/code&gt;, export upper/lower-case proxy variables, and launch the original Electron binary with &lt;code&gt;--proxy-server&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;If the target app also uses Node/undici &lt;code&gt;fetch&lt;/code&gt;, inject a very small &lt;code&gt;NODE_OPTIONS=--require=...&lt;/code&gt; bootstrap so Node-side requests follow the same proxy path.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;All proxy endpoints in this article are intentionally redacted and replaced with placeholders such as:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;http://127.0.0.1:PORT&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Replace that value with your own local proxy entrypoint. &lt;strong&gt;Do not publish real proxy hosts, internal IP addresses, usernames, passwords, tokens, or internal domains in a public article, repository, or screenshot.&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
