Connecting

  1. After you request SGS service in a region, SaladCloud will provision and test a new, dedicated SGS server before sending you its connection details, which will include a unique SGS hostname, port number, password, and other basic information.

    Note that this documentation assumes you are using HTTP CONNECT requests. SGS also supports HAProxy’s PROXY v2 protocol. Learn how to use it here.

  2. All requests should be made through the SGS server using this connection information. The SGS server will then route them to the appropriate SaladCloud node. For example, https://SESSION_ID:PASSWORD@HOSTNAME:PORT/

    • Let’s break down each component: SESSION_ID, PASSWORD, HOSTNAME, and PORT.
      • SESSION_ID can be anything you like, as a string encoded in ASCII or UTF8. There are no character length limits enforced. Each session ID will be associated with one SaladCloud node. Because all requests sent through a single session ID will be proxied through the same node, we recommend using separate session IDs for each of your end users. If a SaladCloud node goes offline for any reason, all connections that it was servicing will be automatically distributed to one or more nodes using a modified least connections algorithm.
      • PASSWORD is the password for connecting to SGS. It will be shared with you using a 1Password link before beginning the trial period.
      • HOSTNAME is the hostname of the SGS server. It is typically in the format sgs-{unique_string}.salad.com, and will be shared with you before beginning the trial period.
      • PORT is the port of the SGS server you should connect to. It will be shared with you before beginning the trial period.

        Proxy authentication with the SGS server MUST be made using TLS (https endpoint). In addition, requests can only be made to destination addresses using HTTPS.

  3. Using curl, you can check the IP address and region of a node connected to one of your SGS servers:

sgs_connection.sh
curl -x 'https://session123:[email protected]:PORT' https://www.ipinfo.io

Changing the session ID and resending this request will often - but not always - return a different IP address. Because of the nature of the least-loaded routing algorithm used by SGS, and the fact that SGS nodes can support multiple streaming connections simultaneously, multiple connections (session IDs) may be loaded on a single node.