You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 22:13:53 +01:00
Let the proxy use the configured audio port
This commit is contained in:
15
index.js
15
index.js
@@ -19,13 +19,6 @@ const path = require('path');
|
|||||||
const net = require('net');
|
const net = require('net');
|
||||||
const client = new net.Socket();
|
const client = new net.Socket();
|
||||||
|
|
||||||
// Create a WebSocket proxy instance
|
|
||||||
const proxy = httpProxy.createProxyServer({
|
|
||||||
target: 'ws://localhost:8081', // WebSocket httpServer's address
|
|
||||||
ws: true, // Enable WebSocket proxying
|
|
||||||
changeOrigin: true // Change the origin of the host header to the target URL
|
|
||||||
});
|
|
||||||
|
|
||||||
// Other files and libraries
|
// Other files and libraries
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
@@ -36,9 +29,15 @@ const consoleCmd = require('./console');
|
|||||||
const audioStream = require('./stream/index.js');
|
const audioStream = require('./stream/index.js');
|
||||||
const { parseAudioDevice } = require('./stream/parser.js');
|
const { parseAudioDevice } = require('./stream/parser.js');
|
||||||
const { configName, serverConfig, configUpdate, configSave } = require('./server_config');
|
const { configName, serverConfig, configUpdate, configSave } = require('./server_config');
|
||||||
|
|
||||||
const { logDebug, logError, logInfo, logWarn } = consoleCmd;
|
const { logDebug, logError, logInfo, logWarn } = consoleCmd;
|
||||||
|
|
||||||
|
// Create a WebSocket proxy instance
|
||||||
|
const proxy = httpProxy.createProxyServer({
|
||||||
|
target: 'ws://localhost:'+ serverConfig.webserver.audioPort, // WebSocket httpServer's address
|
||||||
|
ws: true, // Enable WebSocket proxying
|
||||||
|
changeOrigin: true // Change the origin of the host header to the target URL
|
||||||
|
});
|
||||||
|
|
||||||
let currentUsers = 0;
|
let currentUsers = 0;
|
||||||
let streamEnabled = false;
|
let streamEnabled = false;
|
||||||
let incompleteDataBuffer = '';
|
let incompleteDataBuffer = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user