chriswiggins / rtsp-streaming-server

Lightweight RTSP/RTP streaming media server written in Javascript
GNU General Public License v3.0
106 stars 21 forks source link

Request to Incorporate 3 commits from flypulse fork #15

Open saket424 opened 4 years ago

saket424 commented 4 years ago

This fork of your project https://github.com/flypulse/rtsp-streaming-server is 3 commits ahead. Can you review them and incorporate the changes into your repo?

Thanks in advance

chriswiggins commented 4 years ago

@saket424 What changes exactly? Have you tried the fork?

saket424 commented 4 years ago
Yes I have tried the flypulse forked repo

One commit adds support to node versions higher than 10.0 in package.json
The other two commits are detailed below

commit 8ca12eae2cbab3cdf9c6937620507fcc4047c84b:'Do not crash when invalid rtsp is sent.'
src/lib/Client.ts
-98,8 +98,8 @@ export class Client {

    debug(
      '%s:%s Client set up for path %s, local ports (%s:%s) remote ports (%s:%s)',
-     req.socket.remoteAddress,req.socket.remotePort,
-     this.stream.mount.path,
+     this.remoteAddress,req.socket.remotePort,
+     this.mount.path,
      this.rtpServerPort,this.rtcpServerPort,
      this.remoteRtpPort,this.remoteRtcpPort
    );

commit bd4ad671648d880f35eb20b830405fbcb2856026:'Can accept "stream" instead of "streamid"'
src/lib/utils.ts
@@ -1,7 +1,7 @@
import debug, { IDebugger } from 'debug';
import { URL } from 'url';

- const mountRegex = /(\/\S+)(?:\/streamid=)(\d+)/;
+ const mountRegex = /(\/\S+)(?:\/(streamid|stream)=)(\d+)/;

export interface MountInfo {
  path: string;
@@ -16,12 +16,12 @@ export function getMountInfo (uri: string): MountInfo {
    streamId: -1
  };

-  if (urlObj.pathname.indexOf('streamid') > -1) {
+  if (urlObj.pathname.indexOf('stream') > -1) {
    const match = urlObj.pathname.match(mountRegex);

    if (match) {
      mount.path = match[1];
-     mount.streamId = parseInt(match[2], 10);
+     mount.streamId = parseInt(match[3], 10);
    }
  }