SquidMan
SquidMan enables developing websites locally on your Mac, and testing from your phone/tablet possible — even for sites that require the exact domain in their configuration to route properly.
In most cases a wildcard DNS service like xip.io or Vagrant Share is the simplest way to route external requests into your local environment. This is great if your site will function with a random subdomain or IP address.
But if your site requires a specific domain in its configuration (like Magento) then wildcard services won’t work.
SquidMan solves this when:
- Your computer and device are connected to the same WiFi network.
- Your device can be configured to use an HTTP proxy.
The proxy lets devices on your network access servers running on your Mac using the same domain you access locally.
SquidMan doesn’t enable devices outside your network to access your local sites. You still need a demo server for that.
Install
Download, install, and run SquidMan.
Give admin access.
Give squid
the ability to accept incoming network connections.
Preferences
General
HTTP Port: 8080
Clients
Add the IP address of devices being used.
Template
Find this line:
# protect web apps running on the proxy host from external users
http_access deny to_localhost
And comment out the config:
# protect web apps running on the proxy host from external users
#http_access deny to_localhost
Note: I didn’t need to do the next step.
Add this config:
# hosts file
hosts_file /etc/hosts
Usage
Find iOS device’s IP address
Add the IP address of devices being used to SquidMan preferences.
- In iOS, go to
Settings > Wi-Fi > {network}
. - Press the
i
icon for network info. - Get the IPV4 address. Example:
192.168.1.70
- Add this IP to SquidMan under
Preferences > Clients
.
Start Squid
- Open the SquidMan app on your Mac.
- Start the Squid service.
Find your Mac’s IP address
Apple > System Preferences > Network
- Get the IP adddress.
Configure iOS to use proxy
- Go to
Settings > Wi-Fi > {network}
. - Tap
i
icon for network info. - Set
HTTP Proxy = Manual
. - Set
IP Address
to your Mac’s IP address. - Set
Port = 8080
(the port you specified in SquidMan’s preferences).
Success
You can now access local environments running on your Mac like http://magento.test/
from your devices.
Stopping Squid
From your Mac
- Stop the Squid service.
- Quit the SquidMan application.
From your iOS device
- Go to
Settings > Wi-Fi > {network}
. - Tap
i
icon for network info. - Set
HTTP Proxy = Off
.