Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & App Percy
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Run Flutter tests behind proxy settings

Set up Local Testing behind a proxy or a MITM proxy so that your Flutter integration tests reach internally hosted servers and assets.

If you have set up Local Testing correctly but your Flutter tests still can’t load internally hosted servers or assets, your network is probably behind a proxy. Pass the proxy details to the Local binary so that traffic between BrowserStack devices and your servers resolves the same way it does on your machine.

This feature is available on Android devices only.

BrowserStack supports Local Testing through the following proxy types:

  • Proxy with no authentication or HTTP basic authentication.
  • MITM proxy with no authentication or HTTP basic authentication.
  • PAC with no authentication.

For Local Testing to work correctly, bypass traffic for bs-local.com in your proxy server.

The setup varies with the proxy implementation in your network. Contact your network or IT team to find the proxy settings that apply to you.

Proxy

Proxies are commonly set up for office networks, remote servers, and sometimes on local machines. Contact your network or IT team to obtain the Proxy Host and Proxy Port. After you have them, use the --proxy-host and --proxy-port flags to establish a Local Testing connection:

Copy icon Copy
Copy icon Copy

If your proxy requires authentication, add --proxy-user and --proxy-pass to the command:

Copy icon Copy
Copy icon Copy

To resolve all requests on BrowserStack devices through your proxy, add the --force-proxy and --force-local flags to the command. Without these flags, the Local binary tries to connect directly for better performance.

MITM proxy

If your proxy type is MITM, such as BrowserMob, you need the Proxy Host and Proxy Port as well. Use the --local-proxy-host and --local-proxy-port flags to establish the connection:

Copy icon Copy
Copy icon Copy

If your local proxy requires authentication, add --local-proxy-user and --local-proxy-pass to the command:

Copy icon Copy
Copy icon Copy

To resolve all requests on BrowserStack devices through your local proxy, add the --force-proxy and --force-local flags to the command.

Run your build through the connection

After the Local Testing connection is up, set the local parameter to true in your build REST API request so that the build runs through the tunnel:

Copy icon Copy

Replace the app and testSuite values with the app_url and test_url of the app and test suite you uploaded to BrowserStack.

If your network resolves proxies through a PAC file instead, see Work with PAC files for Flutter tests.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle