Manage incoming connections for Flutter tests
Test Flutter apps that fetch data from localhost, private, internal, or firewalled servers using Local Testing on BrowserStack App Automate.
When your Flutter app depends on data hosted inside your own network, Local Testing lets BrowserStack devices reach those servers securely. The following sections explain how to test apps that pull data from localhost servers, from private or internal servers, and from servers behind a firewall or VPN.
This feature is available on Android devices only.
Test apps that retrieve data from localhost servers
After you enable Local Testing, BrowserStack devices can reach apps that retrieve data from your localhost servers. Set the local parameter to true when you execute the build:
Test apps that retrieve data from private or internal servers
You can test apps that retrieve data from private or internal servers using the --force-local flag. This flag resolves all requests from BrowserStack devices through your local machine.
Use the --force-local flag while establishing a Local Testing connection:
After you establish the connection, your Flutter tests can reach your internally hosted servers, for example staging.example.com.
Test apps that retrieve data from servers behind a firewall, a VPN, or both
With Local Testing, you can test apps that retrieve data or assets from internal servers behind firewalls, VPNs, or both.
Start by confirming that you can reach the server from your own machine. Then set up the connection by following the steps in Test apps that retrieve data from private or internal servers.
Connection duration and disconnection
The Local Testing connection is persistent. Your machine and BrowserStack stay connected until you explicitly end the connection. Open and close the connection as follows:
| Setup | Details |
|---|---|
| CI server | Write a script that establishes the Local Testing connection before the build runs. Close the connection after the build finishes. |
| Binary | Run the Local binary from the command line with the appropriate flags before you trigger the build. Close the connection after the build finishes. |
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
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!