Jump to content
Not connected, Your IP: 35.175.107.77
airvpnforumuser

Request: Can we get session events on Bluetit please (and an internal API)?

Recommended Posts

Hey

Can we get session events on Bluetit such that when an event happens it can be accessed in some way - for example, when starting a connection or if it dies, perhaps something can be written to a file or somehow can be accessed so that a script can hook into that.

It would also be useful to have an API where you can request certain pieces of data (similar to that of goldcrest --bluetit-stats), for example: goldcrest --bluetit-data -item=bandwidth,speed,dns,ip,load,connection_status -format=json,xml,txt --output-to-file=/home/data.txt

Thanks.

Share this post


Link to post

@airvpnforumuser

Hello!
 

Quote


Can we get session events on Bluetit such that when an event happens it can be accessed in some way - for example, when starting a connection or if it dies, perhaps something can be written to a file or somehow can be accessed so that a script can hook into that.


Please check Bluetit Developer's Reference Manual chapter 5.5, Bluetit events, p. 64.
 
Quote


It would also be useful to have an API where you can request certain pieces of data (similar to that of goldcrest --bluetit-stats), for example: goldcrest --bluetit-data -item=bandwidth,speed,dns,ip,load,connection_status -format=json,xml,txt --output-to-file=/home/data.txt


You already have it. Note incidentally that all Goldcrest options are worked out through Bluetit methods. Bluetit exposes a D-Bus interface and the D-Bus IPC daemon lets your software call a wide variety of methods. Detailed reference can be found in Chapter 5, Bluetit D-Bus Interface, pp. 53 and following ones.

For the specific example you mention, the connection_stats public method is what you need. Please check Bluetit Developer's Reference Manual  5.4, Public D-Bus methods, and 5.4.16 connection_stats, p. 61.

Kind regards

Share this post


Link to post

Thanks for the pointers - say I wanted to use Python/NodeJS, are you able to provide examples of how to fetch this information? Personally, dumping a JSON payload to a file (or rather, a specific command via exec or something similar) seems much easier than using d-bus, but it may actually be trivial?

Personally, the one thing that the manual could benefit from is examples using different languages - not everyone uses/is proficient with C++ and would make it simple to understand how your library can be implemented elsewhere (in fact, such a project/pesudo-project on Gitlab would be very nice indeed).

Thanks.

Share this post


Link to post
@airvpnforumuser
 
Quote


Personally, the one thing that the manual could benefit from is examples using different languages - not everyone uses/is proficient with C++ and would make it simple to understand how your library can be implemented elsewhere (in fact, such a project/pesudo-project on Gitlab would be very nice indeed).


Hello!

All the code examples in the manual are in C++. C++ for the AirVPN Suite has been picked for a variety of reasons including high portability, speed and efficiency.

From page 10:
 
Quote

The preferred method of inter-operating with Bluetit is by using AirVPN–SUITE C++ classes, although this is limiting the development of a client in C++ only.

All the AirVPN–SUITE classes can be virtually ported to any object-oriented programming language provided it can offer access or support to D-Bus.

Also note AirVPN–SUITE classes are based on D-Bus low level C API and the use of an object-oriented programming language is not mandatory provided the target functions and/or classes are developed according to the AirVPN–SUITE classes marshaling mechanism, which is essential for the whole architecture in order to exchange data to and from the clients and the daemon.


We do not rule out other programming interfaces for other languages according to requests in the future.

Kind regards


 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image

×
×
  • Create New...