Examples

Karel Donk edited this page Aug 31, 2018 · 7 revisions

Example Projects

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

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.

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.
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.
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.
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.