Skip to content

Instantly share code, notes, and snippets.

@BjornW
Last active August 26, 2015 13:30
Show Gist options
  • Save BjornW/49a3b02fe63b3bc7c7e0 to your computer and use it in GitHub Desktop.
Save BjornW/49a3b02fe63b3bc7c7e0 to your computer and use it in GitHub Desktop.
Howto test websites run in Vagrant on my development machine with my phone using Privoxy

My development machine runs Ubuntu (14.04) and I'd like to test my webapplications which are developed in a Vagrant box with my phone. This is how I made this possible:

  1. Install Privoxy (sudo apt-get update && sudo apt-get install privoxy)
  2. Check your local ip-address
  3. Change the listen address in Privoxy's config file (/etc/privoxy/config) to your local ip-address (usually starts with 192.168.x or 10.0.x)
  4. Run Privoxy (sudo service privoxy start)
  5. Check if the proxy works, by setting your browser on your development machine to use Privoxy as it's proxy. And then go to http://p.p and it should show your Privoxy running
  6. On your phone (I'm using Android 4) make sure to use the same network as your development machine and setup the wifi to use your development machine as a proxy (long press on the wifi AP name to access the connection settings). Use the listen adddress you've supplied Privoxy with
  7. Pro-tip: Don't forget to let your firewall allow connections to your proxy for now!!
  8. Browse to your local webapplication on your development machine, e.g. http://myproject.dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment