fix addresses

This commit is contained in:
srgooglo 2022-05-12 11:05:52 +02:00
parent 27972f3f5f
commit a86918d3b9

View File

@ -4,10 +4,11 @@ import { nanoid } from "nanoid"
import axios from "axios" import axios from "axios"
const streamingServerAddress = process.env.mediaServerAddress ?? "media.ragestudio.net" const streamingMediaServer = process.env.streamingMediaServer ?? "media.ragestudio.net"
const streamingServerAPIPort = process.env.mediaServerAPIPort ?? 3002 const streamingServerAPIAddress = process.env.streamingServerAPIAddress ?? "media.ragestudio.net"
const streamingServerAPIProtocol = process.env.mediaServerAPIProtocol ?? "http" const streamingServerAPIPort = process.env.streamingServerAPIPort ?? 3002
const streamingServerAPIUri = `${streamingServerAPIProtocol}://${streamingServerAddress}:${streamingServerAPIPort}` const streamingServerAPIProtocol = process.env.streamingServerAPIProtocol ?? "http"
const streamingServerAPIUri = `${streamingServerAPIProtocol}://${streamingServerAPIAddress}:${streamingServerAPIPort}`
export default class StreamingController extends Controller { export default class StreamingController extends Controller {
static useMiddlewares = ["withAuthentication"] static useMiddlewares = ["withAuthentication"]
@ -33,7 +34,7 @@ export default class StreamingController extends Controller {
// TODO: meanwhile linebridge remote linkers are in development we gonna use this methods to fetch // TODO: meanwhile linebridge remote linkers are in development we gonna use this methods to fetch
const { data } = await axios.get(`${streamingServerAPIUri}/streams`).catch((error) => { const { data } = await axios.get(`${streamingServerAPIUri}/streams`).catch((error) => {
res.status(500).json({ res.status(500).json({
error: `Failed to fetch streams from [${streamingServerAddress}]: ${error.message}` error: `Failed to fetch streams from [${streamingServerAPIAddress}]: ${error.message}`
}) })
return false return false
}) })
@ -49,7 +50,7 @@ export default class StreamingController extends Controller {
protocol: "rtmp", protocol: "rtmp",
port: "1935", port: "1935",
space: "live", space: "live",
address: streamingServerAddress, address: streamingMediaServer,
}) })
}, },
"/streaming_key": async (req, res) => { "/streaming_key": async (req, res) => {