cluster

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 17 Imported by: 1

README

cluster plugin

cluster plugin for monibuca 实现了基本的集群功能,里面包含一对发布者和订阅者,分别在主从服务器中启用,进行连接。 起基本原理就是,在主服务器启动端口监听,从服务器收到播放请求时,如果从服务器没有对应的发布者,则向主服务器发起请求,主服务器收到来自从服务器的请求时,将该请求作为一个订阅者。从服务器则把tcp连接作为发布者,实现视频流的传递过程。

插件名称

Cluster

配置

源服务器的配置是ListenAddr,用来监听从服务器的请求。 边缘服务器的配置是OriginServer,表示源服务器的地址。 当然服务器可以既是源服务器也是边缘服务器,即充当中转站。

边缘服务器的配置

[Cluster]
OriginServer = "localhost:2019"

源服务器的配置

[Cluster]
ListenAddr = ":2019"

示意图

sketch

Documentation

Index

Constants

View Source
const (
	MSG_AUDIO byte
	MSG_VIDEO
	MSG_SUBSCRIBE
	MSG_AUTH
	MSG_SUMMARY
	MSG_LOG
	MSG_PUBLISH
)

Variables

This section is empty.

Functions

func ListenBare

func ListenBare(addr string) error

func PullUpStream

func PullUpStream(streamPath string)

Types

type Receiver

type Receiver struct {
	Publisher
	io.Reader
	*bufio.Writer
}

func (*Receiver) Auth

func (p *Receiver) Auth(authSub *Subscriber)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL