3 Star 10 Fork 5

baoyalive / baoyalive

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README-en.md

Live source code, short video, live with goods, games to play, imitation than the heart, hunting, TT voice chat, beauty about to play, play with the system source code open black, about to play source code


English | 简体中文

Front-end: Vue Mobile Terminal: Android + iOS

The micro service (Docker container) consists of:

  • goim :Bilibili station IM architecture:
  • livego :High-performance RTMP server based on Golang test model: Aliyun 32 core 64G exclusive server 30000 concurrent pull stream, CPU occupation rate is less than 50%!
  • webrtc :Janus Gateway: MeetEcho's excellent universal WebRTC server (SFU);
  • MongoDB :Distributed database based on documents built in cloud era;
  • Redis:In-memory data structure storage, used as a database, cache, and message broker;
  • kafka :Queue group chat, private chat, message notification, etc.
  • Coturn :Open source projects for Turn and Stun Server;
  • Nginx :High performance load balancer, Web server and reverse proxies supported by HTTP3 / Quiche and Brtoli;
  • Docker:A platform for building, deploying, and managing containerized applications.
  • Admin: PHP (old business PHP backend) + GIN (API interface refactoring) + VUE + ELEMent-UI

Contact us:


WeChat:BCFind5 【Please note the good information】

Telegram:@BCFind5


Background presentation address: http://www.jinqianlive.com/admin

user :test pass: test


Live short video https://baoya.lanzous.com/imcL9e57tej


Voice chat room http://app.6sjs.com/wej8


IOS :https://pan.baidu.com/s/18KaHu-39TMQLetb0m7XD0Q 提取码:v929


doc:http://www.jinqianlive.com/appapi/listAllApis.php?type=expand


The front-end display The front-end display

Backend interface Backend interface


Technical structure

System development language

  • PHP | golang video interactive system by the WEB system, REDIS service, MYSQL services, video services, chat, background management system, and regularly monitor, background management using PHP + golang language development, all services provide lateral extension.

Environment set up

Install golang

wget http://www.golangtc.com/static/go/go1.3.linux-amd64.tar.gz
tar -C /usr/local -zxvf  go1.3.linux-amd64.tar.gz 
vim /etc/profile	
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
export GOPATH="$HOME/go

success

install etcd

curl -L https://github.com/coreos/etcd/releases/download/v3.3.2/etcd-v3.3.2-linux-amd64.tar.gz -o etcd-v3.3.2-linux-amd64.tar.gz
tar -zxf etcd-v3.3.2-linux-amd64.tar.gz
mv etcd-v3.3.2-linux-amd64/etcd* /$GOPATH/bin
./etcd 

success

install Protobuf tools

mkdir /www/go/live
cd /www/go/live
go mod init live
#go.mod file

Go Micro RPC

go get github.com/micro/go-micro

install protoc

from https://github.com/protocolbuffers/protobuf/releases down`new`version protoc :
./configure
make && make install
protoc --version

success

install protoc-gen-micro

go get -u github.com/micro/protoc-gen-micro

install protoc-gen-go

go get -u github.com/golang/protobuf/protoc-gen-go

cp protoc-gen-* /usr/local/bin/

$GOPATH/bin copy /usr/local/bin 

mkdir /www/go/live/proto
syntax = "proto3";

service Live {
rpc Call(LiveRequest) returns (LiveResponse) {}
}

message LiveRequest {
string name = 1; 
}

message liveResponse {
string result = 1;
}
protoc auto code
protoc --proto_path=. --micro_out=. --go_out=. proto/live.proto

Write the Go service implementation code live make mian.go

package main

import (
	"context"
	"fmt"
	"github.com/micro/go-micro"
	proto "live/proto"
)

type LiveServiceHandler struct{}

func (g *LiveServiceHandler)Call(ctx context.Context, req *proto.LiveRequest, rsp *proto.LiveResponse) error {
	rsp.Result = "github:https://github.com/DOUBLE-Baller/" + req.Name
	return nil
}

func main()  {
	service := micro.NewService(
		micro.Name("go.micro.api.Live"), //go.micro.api namespace
	)

	// init
	service.Init()

	// register
	proto.RegisterLiveHandler(service.Server(), new(LiveServiceHandler))

	// run
	if err := service.Run(); err != nil {
		fmt.Println(err)
	}
}
go run main.go
attention:add MICRO_REGISTRY=etcd used go run main.go --registry=etcd 

failure

attention:add go.mod last
replace google.golang.org/grpc => google.golang.org/grpc v1.26.0

use go micro provide HTTP API

go get github.com/micro/micro/v2

finish, $GOPATH/bin make micro run,cp from /user/local/bin 
micro api --handler=rpc
default:8080 

visit IP:8080

micro call go.micro.api.Live Live.Call '{"name": "momo"}'

goim

Terry-Mao/goim is a IM and push notification server cluster.



Features

  • Light weight
  • High performance
  • Pure Golang
  • Supports single push, multiple push, room push and broadcasting
  • Supports one key to multiple subscribers (Configurable maximum subscribers count)
  • Supports heartbeats (Application heartbeats, TCP, KeepAlive)
  • Supports authentication (Unauthenticated user can't subscribe)
  • Supports multiple protocols (WebSocket,TCP)
  • Scalable architecture (Unlimited dynamic job and logic modules)
  • Asynchronous push notification based on Kafka

Installing

Dependencies

$ yum -y install java-1.7.0-openjdk

Install Kafka

Please follow the official quick start here.

Install Golang environment

Please follow the official quick start here.

Deploy goim

1.Download goim

$ yum install git
$ cd $GOPATH/src
$ git clone https://github.com/Terry-Mao/goim.git
$ cd $GOPATH/src/goim
$ go get ./...

2.Install router、logic、comet、job modules(You might need to change the configuration files based on your servers)

$ cd $GOPATH/src/goim/router
$ go install
$ cp router-example.conf $GOPATH/bin/router.conf
$ cp router-log.xml $GOPATH/bin/
$ cd ../logic/
$ go install
$ cp logic-example.conf $GOPATH/bin/logic.conf
$ cp logic-log.xml $GOPATH/bin/
$ cd ../comet/
$ go install
$ cp comet-example.conf $GOPATH/bin/comet.conf
$ cp comet-log.xml $GOPATH/bin/
$ cd ../logic/job/
$ go install
$ cp job-example.conf $GOPATH/bin/job.conf
$ cp job-log.xml $GOPATH/bin/

Everything is DONE!

Run goim

You may need to change the log files location.

$ cd /$GOPATH/bin
$ nohup $GOPATH/bin/router -c $GOPATH/bin/router.conf 2>&1 > /data/logs/goim/panic-router.log &
$ nohup $GOPATH/bin/logic -c $GOPATH/bin/logic.conf 2>&1 > /data/logs/goim/panic-logic.log &
$ nohup $GOPATH/bin/comet -c $GOPATH/bin/comet.conf 2>&1 > /data/logs/goim/panic-comet.log &
$ nohup $GOPATH/bin/job -c $GOPATH/bin/job.conf 2>&1 > /data/logs/goim/panic-job.log &

If it fails, please check the logs for debugging.

Testing

Check the push protocols herepush HTTP protocols

Configurations

TODO

Examples

Websocket: Websocket Client Demo

Android: Android SDK

iOS: iOS

Documents

push HTTP protocols

Comet client protocols

==The problem of feedback==

Please let us know if you have any problems during use. You can use the following contact information to communicate with us

Comments ( 1 )

Sign in for post a comment

About

php直播,直播源码,短视频,直播带货,比心陪玩等 spread retract
PHP and 6 more languages
MIT
Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more
PHP
1
https://gitee.com/baoyalive/baoyalive.git
git@gitee.com:baoyalive/baoyalive.git
baoyalive
baoyalive
baoyalive
master

Search