ftlserver

package module
v0.0.0-...-93a34c3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 12 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

ftlserver

Go/Golang ftl server package which should make it easier to develop an FTL or OBS/FTL server

This is used by:
https://github.com/x186k/deadsfu
https://github.com/x186k/ftl-proxy

Example command usage:

c@macmini ~/D/ftlserver (main) [1]> go run ./cmd
2021/09/14 20:58:55 main.go:29: waiting for accept
2021/09/14 20:59:16 main.go:37: socket accepted
2021/09/14 20:59:16 main.go:29: waiting for accept
2021/09/14 20:59:16 ftlserver.go:51: OBS/FTL GOT TCP SOCKET CONNECTION
2021/09/14 20:59:16 ftlserver.go:84: ftl: got hmac
2021/09/14 20:59:16 ftlserver.go:94: ftl: got hmac blank
2021/09/14 20:59:16 ftlserver.go:115: ftl: got connect
2021/09/14 20:59:16 ftlserver.go:144: ftl: auth is okay: true
2021/09/14 20:59:16 ftlserver.go:176: ftl: key/value VideoHeight 720
2021/09/14 20:59:16 ftlserver.go:176: ftl: key/value VideoWidth 1280
2021/09/14 20:59:16 ftlserver.go:176: ftl: key/value VideoIngestSSRC 124
2021/09/14 20:59:16 ftlserver.go:176: ftl: key/value AudioCodec OPUS
2021/09/14 20:59:16 ftlserver.go:176: ftl: key/value ProtocolVersion 0.9
2021/09/14 20:59:16 ftlserver.go:176: ftl: key/value VendorName OBS Studio
2021/09/14 20:59:16 ftlserver.go:176: ftl: key/value Video true
2021/09/14 20:59:16 ftlserver.go:176: ftl: key/value VideoCodec H264
2021/09/14 20:59:16 ftlserver.go:176: ftl: key/value AudioPayloadType 97
2021/09/14 20:59:16 ftlserver.go:176: ftl: key/value VendorVersion 27.0.1
2021/09/14 20:59:16 ftlserver.go:176: ftl: key/value VideoPayloadType 96
2021/09/14 20:59:16 ftlserver.go:176: ftl: key/value Audio true
2021/09/14 20:59:16 ftlserver.go:176: ftl: key/value AudioIngestSSRC 123
2021/09/14 20:59:16 ftlserver.go:196: bound inbound udp on [::]:50281
2021/09/14 20:59:16 main.go:60: 1 ftl packets received
2021/09/14 20:59:18 main.go:60: 1362 ftl packets received
2021/09/14 20:59:20 main.go:60: 1438 ftl packets received
2021/09/14 20:59:21 ftlserver.go:225: ftl: ping!
2021/09/14 20:59:22 main.go:60: 2594 ftl packets received
2021/09/14 20:59:24 main.go:60: 3878 ftl packets received
2021/09/14 20:59:26 ftlserver.go:225: ftl: ping!
2021/09/14 20:59:26 main.go:60: 5196 ftl packets received
2021/09/14 20:59:28 main.go:60: 6499 ftl packets received
2021/09/14 20:59:30 main.go:60: 7814 ftl packets received
2021/09/14 20:59:31 ftlserver.go:225: ftl: ping!
2021/09/14 20:59:32 main.go:60: 9093 ftl packets received
2021/09/14 20:59:34 main.go:60: 10387 ftl packets received

Documentation

Index

Constants

View Source
const (
	FTL_INGEST_RESP_UNKNOWN                 = 0
	FTL_INGEST_RESP_OK                      = 200
	FTL_INGEST_RESP_PING                    = 201
	FTL_INGEST_RESP_BAD_REQUEST             = 400 // The handshake was not formatted correctly
	FTL_INGEST_RESP_UNAUTHORIZED            = 401 // This channel id is not authorized to stream
	FTL_INGEST_RESP_OLD_VERSION             = 402 // This ftl api version is no longer supported
	FTL_INGEST_RESP_AUDIO_SSRC_COLLISION    = 403
	FTL_INGEST_RESP_VIDEO_SSRC_COLLISION    = 404
	FTL_INGEST_RESP_INVALID_STREAM_KEY      = 405 // The corresponding channel does not match this key
	FTL_INGEST_RESP_CHANNEL_IN_USE          = 406 // The channel ID successfully authenticated however it is already actively streaming
	FTL_INGEST_RESP_REGION_UNSUPPORTED      = 407 // Streaming from this country or region is not authorized by local governments
	FTL_INGEST_RESP_NO_MEDIA_TIMEOUT        = 408
	FTL_INGEST_RESP_GAME_BLOCKED            = 409 // The game the user account is set to can't be streamed.
	FTL_INGEST_RESP_SERVER_TERMINATE        = 410 // The sterver has terminated the stream.
	FTL_INGEST_RESP_INTERNAL_SERVER_ERROR   = 500
	FTL_INGEST_RESP_INTERNAL_MEMORY_ERROR   = 900
	FTL_INGEST_RESP_INTERNAL_COMMAND_ERROR  = 901
	FTL_INGEST_RESP_INTERNAL_SOCKET_CLOSED  = 902
	FTL_INGEST_RESP_INTERNAL_SOCKET_TIMEOUT = 903
)

Variables

This section is empty.

Functions

func NewTcpSession

func NewTcpSession(inf *log.Logger, dbg *log.Logger, tcpconn *net.TCPConn, findsvr FindServerFunc, ftpUdpPort int)

Types

type FindServerFunc

type FindServerFunc func(inf *log.Logger, dbg *log.Logger, chanid string) (server FtlServer, hmackey string)

type FtlServer

type FtlServer interface {
	TakePacket(inf *log.Logger, dbg *log.Logger, packet []byte) bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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