npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rtmp-interceptor

v2.2.1

Published

A simple TCP server that intercepts RTMP packets in order to get the tcURL and API key, and proxify (or reject) the packets to your remote server ([nginx-rtmp-module](https://github.com/arut/nginx-rtmp-module) for example). It allows you to easily authent

Downloads

4

Readme

rtmp-interceptor

A simple TCP server that intercepts RTMP packets in order to get the tcURL and API key, and proxify (or reject) the packets to your remote server (nginx-rtmp-module for example). It allows you to easily authentify your RTMP stream with your API to accept or reject incoming stream.

Installation:

npm i rtmp-interceptor

Usage

Intercept tcUrl and streamKey

Intercept tcurl, streamkey, then forward the data to the specified rtmp server (localhost:1935).

const RTMPInterceptor = require('rtmp-interceptor')

const params = {
  listenPort: '1936'
}

RTMPInterceptor.listen(params, (client, tcUrl, SKey) => {
  console.log('tcUrl: '+tcUrl)      /* Do something with the data ... */
  console.log('StreamKey: '+SKey)

  return {                          /* Return false to block client and close stream */
    host: 'localhost',
    port: '1935'
  }
})

Open OBS, and start streaming on 'rtmp://localhost:1936/live'

Output:

tcUrl: rtmp://localhost:1936/live StreamKey: specified stream key

Authentify client

You can choose to proxify or reject the client, based on the streamkey or tcurl for example. See this example

Hook streamKey

Hooking the rtmp streamkey could be used when a client hasn't the stream key input (GoPRO for example) It allows you to pass the stream key in the tcurl for example, and hook it into the RTMP packet.

const RTMPInterceptor = require('rtmp-interceptor')

const params = {
  listenPort: '1936'
}

RTMPInterceptor.listen(params, async (client, tcUrl, SKey) => {
  console.log('tcUrl: '+tcUrl)      /* Do something with the data ... */
  console.log('StreamKey: '+SKey)

  return {                          /* Return false to block client and close stream */
    host: 'localhost',
    port: '1935',
    skChunks: ['\u0004\u0000\u0000\u0000\u0000\u0000)\u0014\u0001\u0000\u0000\u0000\u0002\u0000\u0007publish\u0000@\u0014\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0002\u0000\u000bMyHookedKey\u0002\u0000\u0004live']
  }
})


Server will see stream key as: MyHookedKey

Note: This method does not build the chunk: you have to build it yourself and pass the full chunk.

Result with OBS

example/interceptUrl.js

See examples

Features:

  • [x] Intercept RTMP tcUrl
  • [x] Intercept RTMP API KEY
  • [x] Hook stream key
  • [ ] ~~Build stream key chunk~~ (PR is welcomed)