illuspas / Node-Media-Server

A Node.js implementation of RTMP/HTTP-FLV/WS-FLV/HLS/DASH/MP4 Media Server
https://www.npmjs.com/package/node-media-server
MIT License
5.89k stars 1.51k forks source link

How to disable http? #573

Open therealtimester opened 1 year ago

therealtimester commented 1 year ago

The example config mentions that a http server needs to be configured.

http: { port: 8000, allow_origin: '*' }

When I delete the entire http part of the configuration then I get an error when I start node-media-server that "properties of undefined (reading 'mediaroot') cannot be read" so I guess the http part is essentially required so how can I disable it? I want to use express to deliver the http stuff and having 2 http servers would be not required.

alekslucenko commented 1 year ago

Possible issue with your code: outputs could be undefined because the json method returns a Promise, not the content directly https://developer.mozilla.org/en-US/docs/Web/API/Response/json