vpapi - VPN Provider API


This is the API that should be provided by VPN services in order to include them in the "one-click" supported list of VPN providers in the Fruho application.

Two HTTP endpoints are required:

1. Config

/vpapi/<provider_name>/config

This call should return plain/text OpenVPN config file with inline certificates and keys

Example of testing with curl:

curl -u <username>:<password> https://<provider_domain>/vpapi/<provider_name>/config

A custom port (different than 443) may be used.

2. Plans

/vpapi/<provider_name>/plans

Example of testing with curl:

curl -u <username>:<password> https://<provider_domain>/vpapi/<provider_name>/plans

This call should return application/json with the following example structure:

{
"plainid_1":
  {
    "name":"Plan Name 1",
    "timelimit":{"start":1448017551,"period":"month","nop":1},
    "trafficlimit":{"used":0,"quota":4000000000},
    "slist":[
    {
      "id":"0",
      "ccode":"SE",
      "country":"Sweden",
      "city":"Stockholm",
      "ip":"11.22.33.44",
      "ovses":[{"proto":"udp","port":"5353"}, {"proto":"tcp","port":"443"}]
    },
    {
      "id":"1",
      "ccode":"US",
      "country":"United States",
      "city":"New York",
      "ip":"22.33.44.55",
      "ovses":[{"proto":"udp","port":"5353"}, {"proto":"tcp","port":"443"}]
    }
  }
}

where:

  • timelimit determines the time period when plan is valid i.e. it begins at "start" time given in seconds since Unix epoch and lasts number of periods ("nop") where "period" is given as "hour", "day" or "month"
  • trafficlimit determines bandwidth quota per period - currently not used
  • slist describes the server list items as instances of OpenVPN running on "ip" host, "proto" protocol ("udp" or "tcp") and port "port".

Both calls are made by the Fruho application after the user clicks "Import configuration". The HTTPS requests provide client username and password in the form of Basic Authentication so the configuration files and server list may be provided accordingly to user permissions.



Real Time Analytics