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:

  1. Clone the repository locally:

    git clone git@github.com:AgoraIO-Extensions/Agora-Golang-Server-SDK.git
  2. Download the Agora SDK to agora_sdk or agora_sdk_mac directory:

    make deps
  3. Build the SDK:

    make build
  4. 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.zip

    You can also use your own data and modify the data path in examples.

  5. Build the basic examples:

    make examples
  6. 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.