Code Monkey home page Code Monkey logo

pxy's Introduction

pxy

pxy is a Go server that routes incoming livestream data from websockets to an external RTMP endpoint.

This project is a work in progress, I'll update more once I'm done with my sleep.

Context

For a side-project of mine, I've to broadcast livestreams through an external service that uses the RTMP protocol. Flutter, and all the web browsers out there do not support said protocol. Therefore, I built pxy to proxy the livestreams from such clients (via websockets) to the broadcasting RTMP servers. Since RTMP is still widely used in the video streaming industry, I thought amateurs like me could benefit from an implementation like pxy for our side-projects and such.

Status

Fundamentally, pxy works well so far. However, there are probably still bugs that needs be ironed out. If you do find any, feel free to open an issue or make a pull request. Meanwhile, pxy could be used as a reference for how a websocket-RTMP proxy could be built. Using it in production now is a really bad idea.

Try it Out

  1. Firstly, install FFmpeg on your machine (just Google it).

  2. Proceed to clone the project with the command below

git clone https://github.com/chuabingquan/pxy.git && cd pxy-master/
  1. Update your RTMP endpoint address under the constants in cmd/pxy/main.go.
const (
	readBufferSize  = 1024
	writeBufferSize = 1024
	publishURL      = "rtmp://global-live.mux.com:5222/app" // This one here.
)
  1. Execute the following command to build and run the pxy server
go run cmd/pxy/main.go
  1. Access http://localhost:8080 in your browser and supply your stream name/stream key. pxy will append it behind the specified RTMP endpoint address that's mentioned Step 3 (e.g. rtmp://global-live.mux.com:5222/app/{YOUR_STREAM_NAME/KEY})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.