This sample source code contains the sample source code of GoClass Client and GoClass Server. This article describes how to run the sample source code. It is recommended that the client and server be used together. The guidelines are divided into two parts:
The sample code is for reference only when the developer accesses it. ZEGO is not responsible for the follow-up maintenance of the sample source code.
If the developer plans to use the sample source code in a production environment, please make sure to perform sufficient testing before release to avoid potential problems and losses.
Please ensure that the development environment meets the following technical requirements (the following instructions are based on MacOS development computers as examples):
Find the Android Studio software icon on the development computer.
Android Studio software, and click
Open an existing project.
Select the sample source code that has been downloaded at the beginning of this document and open it. The screenshot here takes GoClass demo as an example.
AuthConstants.javafile needs to be modified. Please use the AppID and AppSign obtained in the "Prerequisites" of this article to fill in correctly (You need to add L after AppID), otherwise the sample source code will not work properly.
At the same time, the host address of the locally deployed GoClass server needs to be configured in the corresponding field of BackendApiConstants.java.
Then you can configure the test environment and other switches in ZegoSDKManager.java.
Select a real Android device (recommended) or emulator that is connected to the Internet. When the device has successfully turned on the developer mode and USB debugging function, you can see the Android Studio as shown below:
Change to the following figure:
It shows that the Android Studio software has successfully connected to the Android device, and the sample source code can be run on the device.
Click the build and run button on the Android Studio software to compile and run the sample source code. If there is a problem during the operation, please contact the instant technical support engineer.
go env -w GO111MODULE=onto turn on the golang module.
go env -w GOPROXY=https://goproxy.cnto set up golang proxy.
git clone https://github.com/zegoim/go-class.git
The GoClass sample source code contains the GoClass client source code and server source code. If the developer has downloaded the sample source code package when running the GoClass client source code, there is no need to download it again here.
RedisAddr = "192.168.100.62:6379" # redis host RedisPassword = "" # redis password RedisIndex = 8 # redis database [SmallClass] # Small class class appid related configuration If you don’t need small class scene, you don’t need to care about related configuration AppId = 123456789 AppSecret = "eb2280544902dc1b7ab1fde3985bd083" # ServerSecret obtained from zego console ... MaxPeopleNum = 10 # The maximum number of people online at the same time in the classroom MaxJoinLiveNum = 4 # The maximum number of simultaneous microphones in the small class classroom [LargeClass] # Large class class appid related configuration If you don’t need large class scenario, you don’t need to care about related configuration AppId = 987654321 AppSecret = "13nce767a02dc1b7bd083ab1fde3985" # ServerSecret obtained from zego console ... MaxPeopleNum = 50 # Maximum number of simultaneous online people in large classes MaxJoinLiveNum = 1 # The maximum number of simultaneous microphones in the large class classroom
go_class_roomdirectory and start the service.
cd ../go_class_room go run main.go