Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save crossi202/411250acdc951e9bcb8d4d99ddcf79e1 to your computer and use it in GitHub Desktop.
Save crossi202/411250acdc951e9bcb8d4d99ddcf79e1 to your computer and use it in GitHub Desktop.

Configure Proxy Settings to View Terradue Services Web GUIs Hosted on a Public Cloud infrastructure

Because of the usage of internal names to configure the services (e.g., Hadoop), you will need to perform the following actions:

  • Setup of a SSH tunnel with node,
  • Configure a browser proxy tool (for example FoxyProxy)

After that you will be able to view the Terradue Services Web GUIs.

Part 1. Setup of a SSH tunnel using dynamic port forwarding

To connect to the local web server on the node, you create a SSH tunnel between your computer and the remote node (in the case of an Hadoop cluster, it would be the Master node). This is also known as port forwarding. If you create your SSH tunnel using dynamic port forwarding, all traffic routed to a specified unused local port is forwarded to the local web server on the remote node.This creates a SOCKS proxy and you can then configure your Internet browser to use an add-on such as FoxyProxy to manage your SOCKS proxy settings. Using a proxy management add-on allows you to automatically filter URLs based on text patterns and to limit the proxy settings to domains that match the form of the node's public DNS name. The browser add-on automatically handles turning the proxy on and off when you switch between viewing websites hosted on the node, and those on the Internet.

Before you begin, you need the public IP address of the node. For information about how to locate the node public IP address, see the documentation available at https://docs.terradue.com or raise a question at https://support.terradue.com

Linux, Unix, and Mac OS X

  • Open a terminal window. On Mac OS X, choose Applications > Utilities > Terminal. On other Linux distributions, terminal is typically found at Applications > Accessories > Terminal.
  • Type the following command to open an SSH tunnel on your local machine. Replace 8157 with an unused, local port number, and replace @ with the node public IP or hostname.
ssh -N -D 8157 <username>@<node public ip or hostname>

After you issue this command, the terminal remains open and does not return a response.

NOTE -D signifies the use of dynamic port forwarding which allows you to specify a local port used to forward data to all remote ports on the node's local web server. Dynamic port forwarding creates a local SOCKS proxy listening on the port specified in the command.

  • After the tunnel is active, configure a SOCKS proxy for your browser. For more information, see Part 2. Configure FoxyProxy

When you are done working with the web interfaces on the node, close the terminal window.

Windows

Windows users can use an SSH client such as PuTTY to create an SSH tunnel to the node. Before connecting to the Public Cloud node, you should download and install PuTTY and PuTTYgen. You can find more information at http://docs.terradue.com/developer-sandbox/start/laboratory/index.html#windows-users

When installed PuTTY and your SSH key, please proceed as following:

  • Double-click putty.exe to start PuTTY. You can also launch PuTTY from the Windows programs list.

Note If you already have an active SSH session with the node, you can add a tunnel by right-clicking the PuTTY title bar and choosing Change Settings. If necessary, in the Category list, click Session.

  • In the Host Name field, type
<username>@<node public ip>
  • In the Category list, expand Connection > SSH, and then click Auth.
  • For Private key file for authentication, click Browse and select the .ppk file that you generated.
  • In the Category list, expand Connection > SSH, and then click Tunnels.
  • In the Source port field, type 8157 (an unused local port).
  • Leave the Destination field blank.
  • Select the Dynamic and Auto options.
  • Click Add and then click Open.
  • Click Yes to dismiss the PuTTY security alert.

After the tunnel is active, configure a SOCKS proxy for your browser. For more information, see Part 2. Configure FoxyProxy. When you are done working with the web interfaces on the node, close the PuTTY window.

Part 2. Install and Configure FoxyProxy

FoxyProxy provides a set of proxy management tools that allow you to use a proxy server for URLs that match patterns corresponding to the domains used by the Public Cloud instances.

Firefox

  • Download and install the Standard version of FoxyProxy from https://addons.mozilla.org/en-US/firefox/addon/foxyproxy-standard/
  • Click Firefox > Add-ons.
  • Open FoxyProxy Standard and click Options,
  • In the FoxyProxy Standard dialog, click Default,
  • Select SOCKS5 as Proxy Type,
  • Type localhost as IP address, DNS name, server name,
  • Type 8157 as Port,
  • Enable the option Send DNS through SOCKS5 proxy?,
  • Click on the button Save,
  • Restart Firefox,
  • In the FoxyProxy Standard dialog, choose Use proxy Default for all the URLs.

Chrome

Please note that in the normal navigation, FoxyProxy has to be disabled. It is also possible to enable FoxyProxy based on URL patterns. See the official documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment