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 locally:
git clone git@github.com:AgoraIO-Extensions/Agora-Golang-Server-SDK.git -
Download the Agora SDK to
agora_sdkoragora_sdk_macdirectory:make deps -
Build the SDK:
make build -
Download test data for running 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 and modify the data path in examples.
-
Build the basic examples:
make examples -
Run the basic example:
cd ./bin # Get AGORA_APP_ID and AGORA_APP_CERTIFICATE from agora console export AGORA_APP_ID=xxxx # To enable authentication for your project you need the AGORA_APP_CERTIFICATE from Agora console export AGORA_APP_CERTIFICATE=xxx # For linux, use the following command to load agora sdk library export LD_LIBRARY_PATH=../agora_sdk # For mac, use the following command # export DYLD_LIBRARY_PATH=../agora_sdk_mac ./send_recv_pcm
Follow the instructions in the README to run the advanced examples.
