This repository holds the code examples used for the Agora Signaling SDK for Linux C++ documentation. Clone the repo, run and test the samples, use the code in your own project. Enjoy.
This reference app uses Signaling SDK v2.x.
The runnable code examples are:
- SDK quickstart - the minimum code you need to integrate low-latency, high-concurrency signaling features into your app using Signaling SDK.
- Token authentication - retrieve a token from the server, and use it to connect securely to Signaling as a specific user.
- Presence - get information about the status of users in specified channels.
- Stream channels - communicate with other users in topics.
- Store channel and user data - easily store data for users and channels without the need to set up your own database.
- Data Encryption - integrate built-in data encryption into your Signaling app.
- Geofencing - only connect to Signaling within the specified region.
- Proxy Connection - ensure reliable connectivity for your users when they connect from an environment with a restricted network.
Before getting started with this reference app, ensure you have the following set up:
-
Linux
-
C++
-
Installed the cURL library
sudo apt-get install libcurl4-openssl-dev
To run the sample projects in this repository, take the following steps:
-
Clone the repository
To clone the repository to your local machine, open Terminal and navigate to the
<samples-root>directory where you want to clone the repository. Then, use the following command:git clone https://github.com/saudsami/signaling-sdk-samples-linux.git
-
Integrate the Signaling SDK for Linux
-
Download the Agora Signaling SDK 2.x for Linux and unzip the contents.
-
Copy the file
libagora_rtm_sdk.soto the<samples-root>/libfolder. -
Copy the
includefolder to<samples-root>folder.
-
-
Modify the project configuration
This app loads connection parameters from a configuration file
config.json. If a validserverUrlis provided, all samples use the token server to obtain a token, except the SDK quickstart which uses thetokenparameter in the config file.Ensure that
config.jsonis populated with the required parameter values before running this reference app.uid: The user ID associated with the application.appId: (Required) The unique ID for the application obtained from Agora Console.channelName: The default name of the channel to join.token:An token generated forchannelName. You generate a temporary token using the Agora token builder.serverUrl: The URL for the token generator. See Secure authentication with tokens for information on how to set up a token server.tokenExpiryTime: The time in seconds after which a token expires.
-
Build and run the project
In the project folder, open Terminal and run the following command:
sh +x clean_build.sh
-
Run the samples in the reference app
To run the reference app, execute the following command in the terminal:
./build/SignalingDemo
If you have any questions, issues, or suggestions, please file an issue in our GitHub Issue Tracker.