AWS Marketplace - Selenium Grid Squid Proxy Endpoint Linux Instructions

1. After launching, login using the following username:
OS Ubuntu: ubuntu
OS Debian: admin
OS Amazon Linux: ec2-user
OS RHEL: ec2-user

2. Edit the configuration file /opt/gridc.cfg with your Gridlastic Connect Subdomain ( has a "-gridc" suffix) which is available in your Gridlastic Dashboard after you start your selenium grid. Also specify a remote port in the intervall 9000-9999. If the tunnel does not start (port already in use), try another port.

Note: if you need to use a corporate proxy to reach the internet, add a proxy reference line to the gridc.cfg:

server_addr: ${GRIDC_ENDPOINT_SUBDOMAIN}.gridlastic.com:443
http_proxy: http://corporate-proxy-domain:xxxx
tunnels:
  squid_proxy:
    remote_port: ${GRIDC_REMOTE_PORT}
    proto:
      tcp: 3128
3. Start the selenium grid squid proxy endpoint using environment variables like:
export GRIDC_USERNAME={REPLACE WITH YOUR GRIDLASTIC GRID USERNAME}
export GRIDC_ACCESS_KEY={REPLACE WITH YOUR GRIDLASTIC GRID ACCESS KEY}
/opt/./gridc -config=/opt/gridc.cfg start squid_proxy
4. Verify tunnel status "online". If the status does not change, resize the CMD window to refresh the screen. the output to screen would be like:
gridc                                                                                                                                                                     (Ctrl+C to quit)

Tunnel Status                 online
Version (client/server)       1.2/1.2
Forwarding                    tcp://your_gridlastic_connect_subdomain.gridlastic.com:9999 -> 3128
Press "Ctrl+C" to quit. Use "/opt/./gridc -log=stdout -config=/opt/gridc.cfg start squid_proxy > /dev/null & disown" to run in background.

5. The endpoint "your_gridlastic_connect_subdomain.gridlastic.com:9999" is accessible only by your Gridlastic selenium grid nodes. Note: port 9999 is just an example, select any not in use by another tunnel in the interval 9000-9999.

To tunnel your tests through to your Squid proxy, create a selenium proxy using this endpoint and pass into the webdriver as a capability like in the java example below:
String proxy_server = "your_gridlastic_connect_subdomain.gridlastic.com:9999";
org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
proxy.setHttpProxy(proxy_server).setFtpProxy(proxy_server).setSslProxy(proxy_server);
capabilities.setCapability(CapabilityType.PROXY, proxy)
You can now use your internal AWS ip/dns server names (private or public) in your selenium test scripts like:
driver().get("http://ip-10-0-0-154.ec2.internal");
or reach any web site that the instance have access to like:
driver().get("https://google.com");
Tip: tail the Squid access log:
sudo tail -F /var/log/squid/access.log
Read more about using a Squid proxy with your selenium grid.