nord.web
¶
Serve nord as a web app.
The API can be accessed by opening a websocket connection to ‘/api’.
Requests¶
The API accepts 2 types of request.
Connect¶
A request to connect to a server in the provided country. Countries are specified as case-insensitive ISO alpha-2 codes. An example request is:
{
"method" : "connect",
"country" : "NL"
}
Disconnect¶
A request to disconnect the current OpenVPN connection. An example request is:
{
"method" : "disconnect"
}
Responses¶
Connecting¶
After receiving a “connect” request, the API will send a message to all connected peers with the following example format:
{
"state" : "connecting",
"country" : "nl",
}
Connected¶
When an OpenVPN connection is established, the API will send a message to all connected peers with the following example format:
{
"state" : "connected",
"host" : "nl123.nordvpn.com"
}
Disconnecting¶
After receiving a “disconnect” request, the API will send a message to all connected peers with the following example format:
{
"state" : "disconnecting"
}
Disconnected¶
When an OpenVPN connection is established, the API will send a message to all connected peers with the following example format:
{
"state" : "disconnected"
}
Error
If there was some error on the server side the API will send a message to all connected peers in the following example format:
{
"state" : "error",
"message" : "Something went wrong!"
}