Skip to content

Modal.Proxy reference

Source: packages/modal/src/Proxy.ts

A Modal Proxy: static egress IPs for Sandboxes and Functions. Traffic from a sandbox created with proxy leaves from these IPs, so a database or API can allowlist them.

Proxies are a Modal Team plan feature. Modal proxies have no tags; ownership is inferred from Alchemy state.

One static IP

import * as Modal from "@alchemy.run/modal";
export const Egress = Modal.Proxy("Egress", {});

Two IPs in a region

import * as Modal from "@alchemy.run/modal";
export const Egress = Modal.Proxy("Egress", { region: "us-east-1", ips: 2 });
const sandbox = yield* sandboxes.create({ proxy: egress });