Skip to content

Examples

Karel Donk edited this page Jan 8, 2022 · 12 revisions

Example Projects

These example projects can be found in the Examples folder in the project root. Tutorials can be found on the Tutorials page.

Name Description
QuantumGateStartup This example demonstrates the basic steps to follow to initialize and start the QuantumGate Local instance. The important code can be found in the QuantumGateStartup.cpp file. Refer to the comments in that file for details.
QuantumGateExtender This example shows the minimal code required to write a QuantumGate Extender. The important code can be found in the MinimalExtender.h and MinimalExtender.cpp files. In addition, the QuantumGateExtender.cpp file demonstrates how to initialize the QuantumGate local instance, add the extender to it and then start the local instance. Refer to the comments in those files for details.
QuantumGateExtenderHandshake This example shows how to write an extender that does its own handshake with a Diffie-Hellman key exchange as soon as a peer connects in order to arrive at a shared secret key. The shared secret key is then used to encrypt transmitted text messages. For the truly paranoid, this shows how to implement an additional layer of encryption on top of what QuantumGate already provides. The same could also be done for authentication. The important code can be found in the HandshakeExtender.h and HandshakeExtender.cpp files. In addition, the QuantumGateExtenderHandshake.cpp file demonstrates how to initialize the QuantumGate local instance, add the extender to it and then start the local instance. Refer to the comments in those files for details.
QuantumGateExtenderModule This example shows the minimal code required to write a QuantumGate Extender Module. The important code can be found in the QuantumGateExtenderModule.cpp file. Refer to the comments in that file for details.
QuantumGateConsole This example shows how to write a custom Console Output class. This may be necessary to customize QuantumGate's console output or to redirect that output to another destination (for example a file or a UI control). The important code can be found in the TestConsole.h file. In addition, the QuantumGateConsole.cpp file demonstrates how to use the custom Console Output class and redirect the QuantumGate console output to an instance of the custom class. Refer to the comments in those files for details.
QuantumGateBluetooth This example shows how to use Bluetooth with QuantumGate. It shows scanning for nearby Bluetooth devices and implements simple commands for connecting, disconnecting and sending messages to connected peers over Bluetooth. The important code can be found in the QuantumGateBluetooth.cpp file. Refer to the comments in that file for details.

Other Examples

Please note that these examples often make use of QuantumGate's internal namespaces and APIs because they are internal projects. However, they do demonstrate using the public API as well. The public API is documented in the wiki. Do not use anything in your own projects that's not part of the public API if you don't want things to break a lot more than expected in the future.

Name Description
TestApp The TestApp is developed to test most of the features of QuantumGate. You can find examples of how to use most of the QuantumGate API in this application. The source code can be found in the Test\TestApp folder in the project root. Check out this application if you want to quickly try out some of what QuantumGate is able to offer through a graphical user interface.
TestExtender The TestExtender is developed to test QuantumGate's core functionality. It's very simple and basic but demonstrates, among other things, sending text messages (chat) and files to other connected peers. The source code for the TestExtender can be found in the Test\TestExtender folder in the project root. The TestExtender is integrated in the TestApp and its functionality can be accessed through that application.
Socks5Extender The Socks5Extender is developed to demonstrate the possibility of a SOCKS5 interface to communicate through QuantumGate nodes (via normal connections or relays) similar to TOR. It currently only supports TCP connections. The source code can be found in the Test\Socks5Extender folder in the project root. The Socks5Extender is also integrated in the TestApp, and its functionality can be tried through that application. You'll require at least two instances of the TestApp connected to each other, both running the Socks5Extender. One of them needs to have the Socks5Extender configured to accept incoming connections (by default this is on port 9090). You can configure your browser (or other application such as FTP) to connect via SOCKS5 to that Socks5Extender. Any such connection will then get routed through the other peer(s) connected to that instance and also running the Socks5Extender. There's a small tutorial available showing how to set this up.
Socks5ExtenderModule The Socks5ExtenderModule integrates the Socks5Extender into a QuantumGate Extender Module which can, for example, be loaded via the TestApp as an alternate way of loading and adding the Socks5Extender to the local instance. The source code can be found in the Test\Socks5ExtenderModule folder in the project root.
AVExtender The AVExtender is developed to demonstrate Audio and Video streaming communications using an extender built on top of QuantumGate. The source code can be found in the Test\AVExtender folder in the project root. The AVExtender is integrated in the TestApp and can be tried and tested via running the TestApp and loading the AVExtender from the menu. The functionality on the AVExtender tab then becomes available. If at least two instances of the TestApp are started and connected to each other, video and audio calls can be made to the connected peers using the AVExtender. Note that compressed video will show a delay of about 4 seconds due to how the Microsoft provided H264 video encoder works (it's not suitable for real-time communications because of an initial delay before providing compressed output samples).
Clone this wiki locally