SoftEther VPN Server JSON-RPC Document
+SoftEther VPN Server JSON-RPC API Suite Document
This reference describes all JSON-RPC functions available on SoftEther VPN Server.
-Please note that you can use SoftEther VPN Server JSON-RPC Client Library to call these APIs easily instead of calling JSON through HTTPS.
+You can access to the latest SoftEther VPN Server JSON-RPC Document on GitHub.
+What is SoftEther VPN Server JSON-RPC API Suite?
+The API Suite allows you to easily develop your original SoftEther VPN Server management application to control the VPN Server (e.g. creating users, adding Virtual Hubs, disconnecting a specified VPN sessions).
+-
+
- Almost all control APIs, which the VPN Server provides, are available as JSON-RPC API. +
- You can write your own VPN Server management application in your favorite languages (JavaScript, TypeScript, Java, Python, Ruby, C#, ... etc.) +
- If you are planning to develop your own VPN cloud service, the JSON-RPC API is the best choice to realize the automated operations for the VPN Server. +
- No need to use any specific API client library since all APIs are provided on the JSON-RPC 2.0 Specification. You can use your favorite JSON and HTTPS client library to call any of all APIs in your pure runtime environment. +
- Also, the SoftEther VPN Project provides high-quality JSON-RPC client stub libraries which define all of the API client stub codes. These libraries are written in C#, JavaScript and TypeScript. The Node.js Client Library for VPN Server RPC (vpnrpc) package is also available. +
Principle
Entry point
The entry point URL of JSON-RPC is:
https://<vpn_server_hostname>:<port>/api/
+-
+
- Older versions of SoftEther VPN before June 2019 don't support JSON-RPC APIs. +
- If you want to completely disable the JSON-RPC on your VPN Server, set the
DisableJsonRpcWebApi
variable totrue
on thevpn_server.config
.
+
JSON-RPC specification
You must use HTTPS 1.1 POST
method to call each of JSON-RPC APIs.
All APIs are based on the JSON-RPC 2.0 Specification.
Authentication
+"vpnrpc": Node.js Client Library package for VPN Server JSON-RPC
+If you are willing to develop your original JSON-RPC client for SoftEther VPN, you can use the JavaScript Client Library for VPN Server RPC (vpnrpc).
+-
+
- You can use the
vpnrpc
library in JavaScript for both web browsers (e.g. Chrome, FireFox or Edge) and Node.js.
+ - As a sample code there is the sample.ts program in TypeScript. This sample calls all of available JSON-RPC APIs against the specified SoftEther VPN Server. (Note: This sample code is written in TypeScript.) +
You can use the following command to download the vpnrpc
library package with Node.js.
$ npm install --save-dev vpnrpc
+
+"vpnrpc.ts": TypeScript Client Library for VPN Server JSON-RPC
+If you are willing to develop your original JSON-RPC client for SoftEther VPN, you can use the TypeScript Client Library for VPN Server RPC (vpnrpc.ts).
+-
+
- You can use the vpnrpc.ts library in TypeScript / JavaScript for both web browsers (e.g. Chrome, FireFox or Edge) and Node.js. +
- As a sample code there is the sample.ts program in TypeScript. This sample calls one by one all of available JSON-RPC APIs against the specified SoftEther VPN Server. +
"vpnserver-jsonrpc-client-csharp": C# Client Library for VPN Server JSON-RPC
+If you are willing to develop your original JSON-RPC client for SoftEther VPN, you can use the vpnserver-jsonrpc-client-csharp C# library.
+-
+
- The client library codes for C# is written in pure C# 7.3. It works on .NET Core 2.1 or later on Windows, Linux and macOS. Very comfort with Visual Studio for both Windows or macOS. +
- As a sample code there is the VpnServerRpcTest.cs program in C#. This sample calls one by one all of available JSON-RPC APIs against the specified SoftEther VPN Server. +
HTTPS Authentication
You must specify the following HTTPS custom headers for authentication on each of requests.