CyberGhost API: Plugin Interface

The CyberGhost Plug-in Interface offers 3rd Party developers to extend CyberGhost with additional functionality. The Plug-in Interface is supported for the following platforms at the moment:

  • CyberGhost 5 Windows Client Version >5.0.15.0

How does a plug-in work?

Basically a plug-in is made by an configuration file and an optionally an executable file.  The configuration file will define the commands, which will be executed by the CyberGhost 5 client depending on the event. The file MUST be a ZIP compressed archive and MUST have the extension ".cgp".

The archive MUST contain at least a file "plugin.ini", which will contain necessary configuration options for the plug-in. The archive CAN contain an executable which SHOULD be digitally signed. Non-signed executables will result in a warning message upon installation of the plug-in. 

The plugin.ini MUST contain the following 2 sections:

[INFO]
name=Name of the plug-in
author=Author of the plug-in
website=Website with support/information about the plug-in
description=Short description about the plug-in's functionality
configurecommand=Shell command to be executed, to optionally configure this plug-in, if it contains an attached executable file
[COMMAND_0] event=Event type command=Path to executable file result_type=EXITCODE|DELAY result_value=Command Exit Code | Delay in seconds

 

Additional commands can be added by adding sections like [COMMAND_1] etc.

The following event types can be linked with a command: 

BEFORE_CONNECT Will be fired before an VPN connection will be established  
AFTER_CONNECT Will be fired after a VPN connection has successfully been established  
BEFORE_DISCONNECT Will be fired before a VPN connection got disconnected  
AFTER_DISCONNECT Will be fired after a VPN connection has been disconnected  

In order to specify whether CyberGhost should wait for the command to return or wait a fixed time before continuing the action, there are several additional configuration options

RESULT_TYPE RESULT_VALUE Description
EXITCODE Command Exit Code Will wait for the command/application to be terminated with the specified exit code
DELAY Value Will wait for Value seconds before proceeding

If the plug-in archive contains an executable file, which is used for the command, the command must use the %PLUGINDIR% placeholder:

command="%PLUGINDIR%mypluginexecutable.exe" /myparam1 

Example browser_privacy.cgp

  plugin.ini

[INFO] 
name=Starts Browser in privacy mode
author=CyberGhost SRL
website=http://www.cyberghostvpn.com/plugin/browser_privacy
configurecommand="%PLUGINDIR/browser_plugin.exe" /configure
description=This will start the configured Browser in Privacy Mode.

[COMMAND_0]
event=AFTER_CONNECT
command="%PLUGINDIR/browser_plugin.exe" /configure
result_type=DELAY
result_value=0


browser_plugin.exe

If started with "/configure" it will open a configuration dialog, to specify the browser type and choose the path of the executable browser file.

Distribute your plug-in

You can offer your plug-in on your homepage or give us a notice via support@cyberghost.ro to put it in our Plug-in Repository, where CyberGhost users can download it for free.

Have more questions? Submit a request

Comments

0 Comments
Article is closed for comments.
Powered by Zendesk