Compile and run the sample project
Updated
Set up, compile, and run the sample Server Gateway project provided by Agora.
Agora provides a runnable sample project on GitHub. This page shows you how to clone and run the project to send and receive media streams.
To run the sample project, take the following steps:
-
Clone the repository:
git clone -b release/2.2.8 https://github.com/AgoraIO-Extensions/Agora-Golang-Server-SDK.git -
Download the Agora SDK to the
agora_sdkfolder (Linux) or theagora_sdk_macfolder (macOS):make deps -
Build the SDK:
make build -
Download the test data for the examples:
curl -o test_data.zip https://download.agora.io/demo/test/server_sdk_test_data_202410252135.zip unzip test_data.zipYou can also use your own data. If you do, update the data paths in the examples.
-
Build the basic examples:
make examples -
Run the basic example:
cd ./bin # Get your App ID and App Certificate from Agora Console export AGORA_APP_ID=xxxx # The App Certificate is required if your project uses token authentication export AGORA_APP_CERTIFICATE=xxx # On Linux, load the Agora SDK library export LD_LIBRARY_PATH=../agora_sdk # On macOS, use the following command instead # export DYLD_LIBRARY_PATH=../agora_sdk_mac ./send_recv_pcm
Follow the instructions in the README to run the advanced examples.
