mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2026-09-03 20:53:09 -05:00
Live streaming implementation first step
This commit is contained in:
@@ -98,10 +98,12 @@ import {
|
||||
staticRouter,
|
||||
lazyStaticRouter,
|
||||
servicesRouter,
|
||||
liveRouter,
|
||||
pluginsRouter,
|
||||
webfingerRouter,
|
||||
trackerRouter,
|
||||
createWebsocketTrackerServer, botsRouter
|
||||
createWebsocketTrackerServer,
|
||||
botsRouter
|
||||
} from './server/controllers'
|
||||
import { advertiseDoNotTrack } from './server/middlewares/dnt'
|
||||
import { Redis } from './server/lib/redis'
|
||||
@@ -119,6 +121,7 @@ import { updateStreamingPlaylistsInfohashesIfNeeded } from './server/lib/hls'
|
||||
import { PluginsCheckScheduler } from './server/lib/schedulers/plugins-check-scheduler'
|
||||
import { Hooks } from './server/lib/plugins/hooks'
|
||||
import { PluginManager } from './server/lib/plugins/plugin-manager'
|
||||
import { LiveManager } from '@server/lib/live-manager'
|
||||
|
||||
// ----------- Command line -----------
|
||||
|
||||
@@ -139,14 +142,14 @@ if (isTestInstance()) {
|
||||
}
|
||||
|
||||
// For the logger
|
||||
morgan.token<express.Request>('remote-addr', req => {
|
||||
morgan.token('remote-addr', req => {
|
||||
if (CONFIG.LOG.ANONYMIZE_IP === true || req.get('DNT') === '1') {
|
||||
return anonymize(req.ip, 16, 16)
|
||||
}
|
||||
|
||||
return req.ip
|
||||
})
|
||||
morgan.token<express.Request>('user-agent', req => {
|
||||
morgan.token('user-agent', req => {
|
||||
if (req.get('DNT') === '1') {
|
||||
return useragent.parse(req.get('user-agent')).family
|
||||
}
|
||||
@@ -183,6 +186,9 @@ app.use(apiRoute, apiRouter)
|
||||
// Services (oembed...)
|
||||
app.use('/services', servicesRouter)
|
||||
|
||||
// Live streaming
|
||||
app.use('/live', liveRouter)
|
||||
|
||||
// Plugins & themes
|
||||
app.use('/', pluginsRouter)
|
||||
|
||||
@@ -271,6 +277,9 @@ async function startApplication () {
|
||||
|
||||
if (cli.plugins) await PluginManager.Instance.registerPluginsAndThemes()
|
||||
|
||||
LiveManager.Instance.init()
|
||||
if (CONFIG.LIVE.ENABLED) LiveManager.Instance.run()
|
||||
|
||||
// Make server listening
|
||||
server.listen(port, hostname, () => {
|
||||
logger.info('Server listening on %s:%d', hostname, port)
|
||||
|
||||
Reference in New Issue
Block a user