To accomplish this goal, we suggest using a SOCKS proxy using our QGTunnel software.  


Here are some setup instruction to get you started:


1. Download QGTunnel into the root of your project

curl https://s3.amazonaws.com/quotaguard/qgtunnel-latest.tar.gz | tar xz


2. Login to our Dashboard and setup the tunnel

  • At the top right, click "Settings", then "Setup"
  • On the left, click "Tunnel", then "Create Tunnel"
  • Remote Destination: tcp://hostname.for.your.server.com:625
  • Local Port: 2525
  • Transparent: true
  • Encrypted: false

       Notes on setup: 

  • This setup assumes that your server is located at "hostname.for.your.server.com" and is listening on port 625.
  • The local port is 2525 because port 625 is in the reserved port range (0-1023).)
  • Transparent mode allows us to override the DNS for hostname.for.your.server.com to 127.0.0.1, which redirects traffic to the QGTunnel software.  This means you can connect to either hostname.for.your.server.com or 127.0.0.1 to connect through the tunnel
  • Encrypted mode is disabled.  You should consider whether you need end-to-end encryption.  Usually for protocols that are insecure (like redis) we suggest that you setup STUNNEL or the like.


3. Change your code to connect through the tunnel

    With transparent mode you will only have to change to connect to port 2525 instead of 625.  Without transparent mode, you will want to connect to 127.0.0.1:2525.


4. Change your startup code

Change the code that starts up your application.  Basically you just need to prepend your startup code with "bin/qgtunnel".  So for a Procfile that was previously:

web: yourapplication your arguments

you would now want:

web: bin/qgtunnel yourapplication your arguments


5. Setup the environment variable(s) 

Setup the environment variable QUOTAGUARDSTATIC_URL to be equal to your SOCKS5 URL in the Setup page of our dashboard.  In Heroku this is already done for you when you setup the add-on.


6. Commit and push your code!


7.  If you have problems, enable the environment variable QGTUNNEL_DEBUG=true and then restart your application while watching the logs.  


If you continue to see issues that you can't figure out, send us any information in the logs to Support (please redact any credential, including your QuotaGuard connection URL).


8. After you get everything working, we suggest you download your QGTunnel configuration from our dashboard as a .qgtunnel file and put that in the root of your project.  This keeps your project from not relying on our website during startup.


Happy Emailing!