Use SquidMan to access vhosts on Mac - mhulse/mhulse.github.io GitHub Wiki

Use SquidMan to allow your mobile device to preview your vhosts over the LAN.

Important: Do NOT use .local as your spoof tld as iOS(8) does not like this (for reasons unknown). I choose to use .proxy to make spoofed domains easy to remember (e.g., http://git.proxy).

Spoof

I use Hosts for the spoof.

Spoof example:

screen shot 2014-12-20 at 3 16 37 pm

Note: Don't forget to click the lock icon or close the window, otherwise the spoof may not take effect.

Apache vhost

Example vhost:

<VirtualHost *:80>
	DocumentRoot "/Users/mhulse/github"
	ServerName git.proxy
	ServerAlias www.git.proxy
	ErrorLog "logs/git.proxy-error.log"
	CustomLog "logs/git.proxy-access.log" combined
	#DirectoryIndex index.html
	<Directory "/Users/mhulse/github">
		IndexOptions +FancyIndexing NameWidth=*
		Options +Includes +FollowSymLinks +Indexes
		AllowOverride All
		Order allow,deny
		Allow from all
		Require all granted
	</Directory>
</VirtualHost>

Using the above, enable apache on your local machine.

iOS device IP

Get IP address of your device by going to SettingsWi-Fi and click on the current network’s info icon:

ip-address

Next, look under the “IP ADDRESS” section to find your phone’s IP address:

network-info

SquidMan proxy

Download SquidMan.

Install it. Allow it to install what it needs to get going.

Open preferences; mirror these settings:

general

Input your device’s IP on the ”Clients” page:

clients

On the “Template” page, add a # (comment) at the beginning of the http_access deny to_localhost line. For example:

# protect web apps running on the proxy host from external users
#http_access deny to_localhost

Immediately following, add this code:

# hosts file
hosts_file /private/etc/hosts

Save and “Start Squid” (can’t hurt to restart Apache).

Enable proxy

On your iOS device, back in the current network settings, do this:

proxy

Test

You should now be able to connect to your local machine’s vhosts using your mobile device using spoofed domain from above (i.e., http://git.proxy); note that the http:// is required when trying to connect from you i-device.

Further reading

⚠️ **GitHub.com Fallback** ⚠️