Use this setup when you need to allowlist Browsers traffic through your firewall or API gateway.
By routing traffic through your own static proxy or VPN, you can:
- Pass network traffic through allowlisted infrastructure
- Control your browser’s IP address and location
- Comply with internal security policies, firewalls, and access controls
How to route Browsers through your VPN
Browsers sessions can route traffic through your own static HTTP/HTTPS proxy.
This lets you control the outbound IP. If your systems only allow traffic from trusted IPs, allowlist the IP of your proxy.
- Deploy a VPN or proxy server in your trusted network
- Allowlist that IP in your firewall, backend, or third-party system
- Pass the proxy config into your Browsers session
- Browsers routes browser traffic through your proxy
Custom proxy configuration
import { Browsers } from "@agentmq/browsers";
const browsers = new Browsers({ apiKey: process.env.AGENTMQ_TOKEN! });
async function createSessionWithCustomProxies() {
const session = await browsers.sessions.create({
proxies: [
{
"type": "external",
"server": "http://...",
"username": "user",
"password": "pass",
}
]
});
return session;
}
const session = await createSessionWithCustomProxies();from agentmq.browsers import Browsers
import os
browsers = Browsers(api_key=os.environ["AGENTMQ_TOKEN"])
def create_session_with_custom_proxy():
session = browsers.sessions.create(
proxies=[
{
"type": "external",
"server": "http://...",
"username": "user",
"password": "pass",
},
]
)
return session
session = create_session_with_custom_proxy()Key requirements
- Your proxy must support HTTP or HTTPS
- It must be accessible from Browsers (public IP or via tunnel)
- You must allow traffic from Browsers to your proxy (firewall, VPN config, etc.)
Troubleshooting
If your session fails to connect:
- Make sure your proxy server is publicly accessible or properly tunneled
- Confirm the proxy IP is correctly allowlisted in your system
- Check the proxy authentication credentials
- Ensure you’re using HTTP or HTTPS (Socks5 proxies are not supported)
- Try connecting to the proxy from a local machine to verify it works outside your network
Proxies
Read more about using custom proxies and proxy configuration options.