Speedify Command Line Interface

The Speedify CLI is a cross-platform (Windows and macOS) utility to help command and monitor Speedify without using the traditional user interface. It is meant to be run on the same device that it is controlling.

On success, its exit value is 0 and it prints JSON to the console. On error, its exit value is 1 and it prints a non-JSON error message to the console.

There are wrappers available in Java and Python (for Windows and macOS) to make it easier to interact with these commands in either of those languages.  Contact support to request access.

The CLI contains the following commands:

help

Usage information can be obtained by passing in -h, --help, or invalid parameters.

  $ speedify_cli --help
  speedify_cli v5.4.0.0
   speedify_cli connect [optional country|city|server]
   speedify_cli disconnect
   speedify_cli login <username> <password>
   speedify_cli logout
   speedify_cli mode <redundant|speed>
   speedify_cli ports <port/proto> <port/proto> ...
   speedify_cli show <servers|settings>
   speedify_cli state
   speedify_cli stats [optional duration in seconds]
   speedify_cli version

connect

The connect command connects to the closest server, or a server of your choosing. It prints details of the server it has selected.

 $ speedify_cli connect
  {
     "apiPort" : "80",
     "city" : "chicago",
     "connectedUsers" : 10,
     "country" : "us",
     "currentState" : "ONLINE",
     "currentUsers" : "16",
     "date" : "Thu, 19 Jan 2017 18:02:40 GMT",
     "dc" : "vultr-chicago",
     "expectedDownBw" : "870",
     "expectedUpBw" : "470",
     "hostName" : "ssm-host-us-chicago-1.speedifynetworks.com",
     "id" : "ef1944e0e93b43da2557a04454b15dc8bb134ce0350a2f61666483498005e0a2",
     "latitude" : "41.878114",
     "longName" : "USA - Chicago #1",
     "longitude" : "-87.629798",
     "mType" : "1",
     "machineStats" : {
        "cpuUsage" : 0.193847656250,
        "memUsage" : 0.3541276200293630,
        "netUsage" : {
           "down" : 0.01291726973180077,
           "up" : 0.02409256425531915
        }
     },
     "num" : "1",
     "pVersion" : "3",
     "private" : "no",
     "privateApiPort" : "443",
     "publicIP" : [ "108.61.242.22", "108.61.119.18" ],
     "revision" : "",
     "torrent" : "no",
     "unifiedMetric" : 0.1580016122080003,
     "version" : "4.1.3-1423123"
  }

To connect to the nearest server in a particular country, pass along a two-letter country code drawn from the 

speedify_cli show servers command:

$ speedify_cli connect ca <br>

To connect to a particular city, pass along a two-letter country code and city, drawn from the speedify_cli show servers command:

$ speedify_cli connect us-atlanta <br>

To connect to a specific server, pass along a two-letter country code, city, and number, drawn from the speedify_cli show servers command:

$ speedify_cli connect us-atlanta-3<br>

disconnect

The disconnect command disconnects from the server. It prints the state immediately after the request to disconnect is made.

  $ speedify_cli disconnect
  {
     "desc" : "DISCONNECTING",
     "state" : 5
  }

login

The login command instructs Speedify to connect with the given username and password. It prints the state immediately after the request to login is made. Speedify will then proceed to automatically connect if the login succeeds.

  $ speedify_cli login [email protected] MyCrazyP4ssword
  {
     "desc" : "LOGGING_IN",
     "state" : 5
  }

logout

The logout command disconnects from the server and flushes any user credentials that were stored.

 $ speedify_cli logout
  {
     "desc" : "DISCONNECTING",
     "state" : 5
  }

mode

The mode command instructs Speedify to optimize for maximum connection speed or redundancy. Valid options are speed and redundant

 $ speedify_cli mode speed
  {
     "algorithm" : "VMM",
     "connection_secondary_speed_activation" : 30.0,
     "encrypted" : true,
     "forward_ports" : [],
     "header_compression" : false,
     "retransmission_enabled" : true,
     "startup_connect" : true
  }

ports

The ports command instructs Speedify to request public ports from a Dedicated Speed Server. These settings only go into effect after a reconnect, and they are ignored by public Speed Servers. Requesting a port that is already taken by another user will lead to the connect request failing, and state will return to LOGGED_IN. Calling the ports command with no additional parameters will clear the port forward requests.
$ speedify_cli ports 8080/tcp 8443/udp
{
  "algorithm" : "VMM",
  "connection_secondary_speed_activation" : 30.0,
  "encrypted" : true,
  "forward_ports" : [
  {
    "port" : "8080",
    "proto" : "tcp"
  },
  {
    "port" : "8443",
    "proto" : "udp"  
  } 
 ],
  "header_compression" : false,
  "retransmission_enabled" : true,
  "startup_connect" : true
}
<br>

show settings

The show settings command retrieves the current connection settings. These settings are
sent to the server at connect time, and they can be retrieved at any time.
$ speedify_cli show servers
  {
    {
      "dedicated" : [
         "privateus-atlanta-11",
         "privateus-atlanta-12"
      ],
      "public" : [
         "at-vienna-1",
         "au-sydney-1",
         "au-sydney-2",
         <snip>
         "us-sf-1"
      ]
    }
  }

show servers

The show servers command retrieves the current list of Speed Servers. If you have access to any Dedicated Speed Servers, they appear in a  dedicated array. The public pool of Speed Servers appear in a public array. 

$ speedify_cli show servers
{
 {
  "dedicated" : [
   "privateusatlanta11",
   "privateusatlanta12"
 ],
  "public" : [
    "atvienna1",
    "ausydney1",
    "ausydney2",
    <snip>
    "ussf1"
  ]
 }
}

state

The state command retrieves the current state of the connection. It prints the raw number and a textual description of that number. Possible states are LOGGED_OUT, LOGGING_IN, LOGGED_IN, AUTO_CONNECTING, CONNECTING, DISCONNECTING, CONNECTED, OVERLIMIT, and UNKNOWN

  $ speedify_cli state
  {
     "desc" : "LOGGED_OUT",
     "state" : 0
  }

stats

The stats command subscribes to a feed of connection and session statistics. By default, this feed will continue until the speedify_cli process is terminated, but an optional parameter can be given to stop and exit after the given number of seconds. This can be useful to monitor how many connections are being utilized by Speedify, and what their current network activity level is in bytes per second. 

$ speedify_cli stats 10
  [
     "report_tunnel_connections",
     {
        "time" : 1484853663142,
        "tunnels" : [
           {
              "bInF" : 598,
              "bInFL" : 0,
              "cnnct" : true,
              "guid" : "en0",
              "lsR" : 0.0,
              "lsS" : 0.0,
              "ltMs" : 32,
              "totBps" : 100080
           }
        ]
     }
  ]


  [
     "report_session_stats",
     {
        "days_since_first" : 47,
        "down_benefit" : {
           "combined_mbps" : 0.0,
           "fastest_conn_mbps" : 0.0,
           "num_connections" : 0
        },
        "num_failovers" : 0,
        "num_sessions" : 101,
        "retrans_bytes" : 1658886,
        "total_connected_minutes" : 3926,
        "up_benefit" : {
           "combined_mbps" : 0.0,
           "fastest_conn_mbps" : 0.0,
           "num_connections" : 0
        }
     }
  ]


  [
     "report_tunnel_connections",
     {
        "time" : 1484853664144,
        "tunnels" : [
           {
              "bInF" : 804,
              "bInFL" : 0,
              "cnnct" : true,
              "guid" : "en0",
              "lsR" : 0.0,
              "lsS" : 0.0,
              "ltMs" : 49,
              "totBps" : 124480
           }
        ]
     }
  ]


  [
     "report_session_stats",
     {
        "days_since_first" : 47,
        "down_benefit" : {
           "combined_mbps" : 0.0,
           "fastest_conn_mbps" : 0.0,
           "num_connections" : 0
        },
        "num_failovers" : 0,
        "num_sessions" : 101,
        "retrans_bytes" : 1658886,
        "total_connected_minutes" : 3926,
        "up_benefit" : {
           "combined_mbps" : 0.0,
           "fastest_conn_mbps" : 0.0,
           "num_connections" : 0
        }
     }
  ]

version

The version command can be used to verify the version of Speedify that is installed and running.

  $ speedify_cli version
  {
     "bug" : 2,
     "build" : 3013,
     "maj" : 5,
     "min" : 0
  }

Still need help? Contact Us Contact Us