Enable the Force Local and Force Proxy flags
Understand how and when to use Force Local and Force Proxy.
You can enable the Force Local and Force Proxy flags to force BrowserStackLocal to resolve all connections through your local network or proxy, instead of resolving the requests through the public internet.
Enable Force Local
The Force Local flag ensures that, regardless of any other setting, no asset will be resolved through the public internet and any resolution of URLs that your BrowserStack device does will be routed through the Local tunnel. This flag is typically used to ensure network compliance.
You can enable Force Local from the Live test session by following these steps:
- Go to the Live dashboard.
- On the toolbar, click Local Testing.
- On the Local Testing prompt, select Resolve all URLs through my network.
The test session restarts with the updated Local settings. On the toolbar, you can see that Force Local is on.
You can also enable Force Local from the Local Console or command-line interface. To enable Force Local from the Local Console or command-line interface, follow these steps:
- Open Local Console (
http://localhost:45454
). - In the Tunnel Settings pane, click Show More.
- Enable the Force Local flag.
A success message is displayed confirming that the Force Local flag is enabled.
After you enabled the Force Local flag, BrowserStackLocal resolves all the web traffic through your local network.
- Open a command-line interface.
- Change directory to the directory that contains the BrowserStackLocal binary.
- Run the following command:
Enable Force Proxy
The Force Proxy flag routes all traffic through the proxy you configured. Otherwise, the BrowserStackLocal binary tries to connect directly as well for better performance.
To enable Force Proxy, follow these steps:
- Open Local Console (
http://localhost:45454
). - In the Tunnel Settings pane, click Show More.
- Enable the Force Proxy flag.
- Click Update Command.
A success message is displayed confirming that the Force Proxy flag is enabled.
After you enabled the Force Proxy flag, BrowserStackLocal resolves all the web traffic through your proxy.
- Open a command-line interface.
- Change directory to the directory that contains the BrowserStackLocal binary.
- Run the following command:
Related topics
- For a complete list of BrowserStackLocal flags, see Flags for Local binary.
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!