Local Testing
A quick and easy way to create a tunnel between your machine and our remote browsers.
To test your local or development environment, we provide a quick and easy way to create a tunnel between your machine and the BrowserStack network. Once the local tunnel is connected, you can test your internal web server or local HTML design files in our remote browsers as easily as you would on your local browser.
Features
- Test any web server running on your desktop, staging environment, private internal setup, entries in your hosts configuration file, or even a public web server.
- Tunnel to any local server environment: Apache, IIS, MAMP, local Wordpress, etc.
- Test HTTP Secure (HTTPS) pages.
- Create simultaneous tunnel connections when your web application loads content from multiple servers, this fully supports static files served via CDN.
- If you have subdomains in your web application, you can test them by setting up multiple tunnel connections.
- Test local design files (HTML, CSS, JS, etc) in our remote browsers, without any need to run web server.
- Highly secure tunnel setup providing restricted access to your files only to YOU, in allocated virtual machine. For more read security documentation.
Setup
Web interfaceClick on the 'Web Tunnel' button under the 'Local Testing' panel of the control panel.
- Download BrowserStackTunnel.jar. Open the command line and navigate to the folder in which file was downloaded.
-
To test an internal server, run:
java -jar BrowserStackTunnel.jar <KEY> host1,port1,ssl_flag,host2,port2,ssl_flag...
Example:java -jar BrowserStackTunnel.jar A4f1NGnzrye localhost,3000,0
To test HTML files, run:java -jar BrowserStackTunnel.jar -f <KEY> "<full path to local folder>"
Example:java -jar BrowserStackTunnel.jar -f A4f1NGnzrye "/Applications/MAMP/htdocs/example/"
View more tunnel configuration options » - Go to your dashboard and start testing.
Optional flags:
-v (provides verbose logging), -h (prints help)
Configuration examples
-
Test localhost
-
Test an internal or private server
-
Test HTTPS
-
Content served from multiple servers
-
Configuration in hosts file
-
Test HTML design files
-
Test subdomains
To test web server running on localhost:3000,
Web interface
Enter localhost under 'Host' and 3000 under 'Port' and click 'Finish'.
Command line interface
java -jar BrowserStackTunnel.jar TI3PnSeogaDEcwSyiSzm localhost,3000,0
To test an internal staging server running on staging.example.com,
Web interface
Enter staging.example.com under 'Host' and 80 under 'Port' and click 'Finish'.
Command line interface
java -jar BrowserStackTunnel.jar TI3PnSeogaDEcwSyiSzm staging.example.com,80,0
To test a local web server running on localhost:8080 and HTTPS server running on https://localhost,
Web interface
Enter localhost under 'Host' and 8080 under 'Port'. Check the HTTPS checkbox and enter the SSL port. Click 'Finish' to complete the setup.
Command line interface
java -jar BrowserStackTunnel.jar TI3PnSeogaDEcwSyiSzm localhost,8080,0,localhost,443,1
To test a web server running at https://staging.example.com with static images served from assets1.staging.example.com and assets2.staging.example.com,
Web interface
Enter staging.example.com under 'Host' and 80 under 'Port'. Check the HTTPS checkbox and enter the SSL port. Click 'Add more+' to add more tunnels. Once done, click 'Finish' to complete the setup.
Command line interface
java -jar BrowserStackTunnel.jar TI3PnSeogaDEcwSyiSzm staging.example.com,8080,0,staging.example.com,443,1,assets1.staging.example.com,80,0,assets2.staging.example.com,80,0
To test a web server running on localhost:3000 and we use third party API server with /etc/hosts configuration 192.168.0.201 api.example.com
Web interface
Enter localhost under 'Host' and 3000 under 'Port'. Click 'Add more+' to add api.example.com to 'hosts'. Once done, click 'Finish' to complete the setup.
Command line interface
java -jar BrowserStackTunnel.jar TI3PnSeogaDEcwSyiSzm localhost,3000,0,api.example.com,80,0
To test a local folder,
Web interface
Click on "Browser Folder" to navigate and select the root folder containing HTML design files for testing.
Command line interface
java -jar BrowserStackTunnel.jar -f TI3PnSeogaDEcwSyiSzm <full path to local folder>
To test a web server running at dev.example.com, and two subdomains user1.dev.example.com and user2.dev.example.com,
Web interface
Enter dev.example.com under 'Host' and 80 under 'Port'. Click 'Add more+' to add more tunnels. Once done, click 'Finish' to complete the setup.
Command line interface
java -jar BrowserStackTunnel.jar TI3PnSeogaDEcwSyiSzm dev.example.com,80,0,user1.dev.example.com,80,0,user2.dev.example.com,80,0
Troubleshooting
-
Java applet does not load.
This may happen when your browser is loading multiple pages at once. Therefore, it may take a bit of time to load the Java applet. If Java applet is not enabled, please read Java applet is not enabled in browser. If this still doesn't help, try using another browser or restart the current browser in order to fix this problem.
Mac OS X Users:
[UPDATE]: 19 April 2013
Apple currently blocks Java versions 1.6.0_43 & below due to security vulnerabilities in Java. As a result this may cause the applet to not load. You can read more about Apple's Java related security update here - http://support.apple.com/kb/HT5716, http://support.apple.com/kb/HT5682. To use the Web Tunnel, you can upgrade to Java 1.6.0_45 which is officially supported by Apple by doing the following:- • Run Software Update to update your Mac OS X software (make sure to include the update ‘Java for Mac OS X’).
- • Restart your browser and test if Java works via http://www.javatester.org/version.html
- • If Java works, you can start using the Web Tunnel. If the Java test mentioned above fails, open up Terminal (Applications > Utilities > Terminal) and enter the following commands:
sudo mkdir -p /Library/Internet\ Plug-Ins/disabled
sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled
sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws
- • You should now be able to successfully use the Web Tunnel.
- Java is not installed. If Java is not installed, you can easily download and install Java from Java download page.
-
Java applet is not enabled in browser.
1. Open 'Java Preferences'.
2. Check if Java applets are allowed in the browser - http://www.javatester.org/version.html. If Java applets are not enabled, enabling applets should fix the problem most of the time. You can read more about changing browser settings to enable Java here: http://www.java.com/en/download/help/enable_browser.xml
Changing system settings for:
Mac:
Windows:
3. Enable the Java Console and set 'Enable Tracing', 'Enable Logging' and 'Show Exception' options.
Mac:
Windows:
4. After modifying these settings, restart the browser and launch the Browserstack web tunnel. In the Java console panel, you should see logs with exceptions. Please share these logs with us at support@browserstack.com. -
Port 22 is blocked.
You need to have outbound traffic allowed for following in your corporate firewall to setup tunnel.
54.252.98.222:22
184.72.55.244:22
54.247.108.114:22
54.251.48.57:22
23.23.209.94:22
54.232.97.189:22
54.245.81.76:22