pi-for-office-proxy
v0.2.6-pre
Published
One-command local HTTPS proxy helper for Pi for Office OAuth logins.
Readme
pi-for-office-proxy
Local HTTPS CORS proxy helper for Pi for Office OAuth logins.
Usage
npx pi-for-office-proxyThis command:
- Ensures
mkcertexists (installs via Homebrew on macOS if missing) - Creates certificates in
~/.pi-for-office/certs/when needed - Starts the proxy at
https://localhost:3003, or reuses an already-running healthy proxy on that URL - Picks a random free port only when 3003 is busy and no compatible default proxy is already running
- Starts loopback-only callback listeners for ChatGPT, Anthropic, and Google OAuth so supported logins can complete without copy/paste when possible
- Bridges authenticated ChatGPT Codex requests to the upstream WebSocket transport when Pi for Office requests it (required for GPT-5.6 Luna in Office WebViews)
The bridge matches native Pi's upstream transport identity and UUIDv7 session semantics, and advertises X-Pi-For-Excel-Codex-WebSocket-Bridge: 1 on /healthz. A pre-0.2.5-pre process is intentionally treated as outdated: stop it, then run the current package so Luna is not routed through the unsupported SSE path.
Then in Pi for Office:
- Open
/settings - Enable Proxy
- Set URL to the URL printed by the proxy (normally
https://localhost:3003) - Run
/login
Publishing (maintainers)
Package source lives in pkg/proxy/.
Before packing/publishing, prepack copies runtime files from repo root:
scripts/codex-websocket-bridge.mjsscripts/cors-proxy-server.mjsscripts/proxy-target-policy.mjsscripts/proxy-client-policy.mjs
Publish from this directory:
cd pkg/proxy
npm publish