summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorOlcan <[email protected]>2025-06-11 11:31:38 -0700
committerGitHub <[email protected]>2025-06-11 11:31:38 -0700
commitf75c48323ce65f651381c74ae75a1795e7cc5c45 (patch)
treef955ccd3922fa867f8526eb0cce5553f5ed95d6b /scripts
parent03bc1f314121c381ac4fe19f031fe90fbcf95179 (diff)
fixes to proxy on macos: prevent curl from hanging during wait-for-proxy by adding ipv6 support and timeout (#947)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/example-proxy.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/example-proxy.js b/scripts/example-proxy.js
index 284a2eed..576da849 100755
--- a/scripts/example-proxy.js
+++ b/scripts/example-proxy.js
@@ -6,7 +6,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
-// Example proxy server that listens on 0.0.0.0:8877 and only allows HTTPS connections to example.com.
+// Example proxy server that listens on :::8877 and only allows HTTPS connections to example.com.
// Set `GEMINI_SANDBOX_PROXY_COMMAND=scripts/example-proxy.js` to run proxy alongside sandbox
// Test via `curl https://example.com` inside sandbox (in shell mode or via shell tool)
@@ -66,8 +66,9 @@ server.on('connect', (req, clientSocket, head) => {
});
});
-server.listen(PROXY_PORT, '0.0.0.0', () => {
- console.log(`[PROXY] Proxy listening on 0.0.0.0:${PROXY_PORT}`);
+server.listen(PROXY_PORT, () => {
+ const address = server.address();
+ console.log(`[PROXY] Proxy listening on ${address.address}:${address.port}`);
console.log(
`[PROXY] Allowing HTTPS connections to domains: ${ALLOWED_DOMAINS.join(', ')}`,
);