k-yle / rtsp-relay

📽 View an RTSP stream in your web browser using an express.js server
https://npm.im/rtsp-relay
MIT License
312 stars 58 forks source link

Needs of express websocket #217

Open ptorrent opened 1 year ago

ptorrent commented 1 year ago

Hello !

Do you realy need express websocket ?

**
 * @param {Application} app the express application
 * @param {import("http").Server | import("https").Server} [server] optional - if you use HTTPS you will need to pass in the server
 */
module.exports = (app, server) => {
  if (!wsInstance) wsInstance = ews(app, server);
  const wsServer = wsInstance.getWss();

  /**
   * This map stores all the streams in existance, keyed by the URL.
   * This means we only ever create one InboundStream per URL.
   * @type {{ [url: string]: InboundStreamWrapper }}
   */

This is how I use your lib:

    this.rstp       = rstp()
    this.rstpProxy  = this.rstp.proxy({
        url: `rtsp://test:test@192.168.76.12/axis-media/media.amp`,
        verbose: false,
    })

I comment

  //if (!wsInstance) wsInstance = ews(app, server);
  //const wsServer = wsInstance.getWss();

and i'm using basic websocket , seems to work

k-yle commented 8 months ago

Good point, as of #74 we don't actually need an explicit dependency on express-ws