Skip to Content
Network & ProxyPort Protection

Port Protection

Block remote pages from scanning localhost and internal service ports during browser sessions.


Prerequisites

  • BotBrowser PRO license or higher.
  • BotBrowser binary with a valid profile loaded via --bot-profile.

Quick Start

Enable port protection with a single flag:

import { chromium } from "playwright-core"; const browser = await chromium.launch({ executablePath: process.env.BOTBROWSER_EXEC_PATH, headless: true, args: [ `--bot-profile=${process.env.BOT_PROFILE_PATH}`, "--bot-port-protection", ], }); const page = await browser.newPage(); await page.goto("https://example.com"); await browser.close();

You can also enable it via profile JSON by setting configs.portProtection to true.


How It Works

When port protection is enabled, BotBrowser prevents remote pages from detecting which services are running on localhost. Connection attempts to commonly-probed ports behave consistently across all loopback addresses, protecting your local environment from being profiled by remote pages.


Common Scenarios

Enabling via CLI flag

--bot-port-protection

Enabling via profile configuration

Set in your profile JSON:

{ "configs": { "portProtection": true } }

Combined with proxy

chromium-browser \ --bot-profile="/path/to/profile.enc" \ --bot-port-protection \ --proxy-server=socks5://user:pass@proxy.example.com:1080

Troubleshooting / FAQ

ProblemSolution
Port protection not workingVerify the flag is included in launch args, or check that configs.portProtection is set in the profile.
Local development tools cannot connectPort protection only affects connections initiated by web pages. Local tools connecting directly are not affected.
Specific port not protectedThe feature covers the most commonly-probed ports. If you need additional coverage, contact support.

Next Steps


Related documentation: Advanced Features: Port Protection | CLI Flags Reference


Legal Disclaimer & Terms of Use Responsible Use Guidelines . BotBrowser is for authorized fingerprint protection and privacy research only.