Pxy – A Go server that proxies websocket livestreams to RTMP servers

栏目: IT技术 · 发布时间: 6年前

内容简介: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 builtFundamentally,

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})

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

移动Web手册

移动Web手册

Peter-Paul Koch(彼得-保罗 科赫) / 奇舞团 / 电子工业出版社 / 2015-4 / 65.00元

《移动Web手册(双色)》主要讲解了移动Web开发和传统PC网站开发的不同之处。作者首先对移动互联网相关的运营商、设备、操作系统和软件进行了简单的介绍,让读者理解移动开发的复杂之处。接下来对移动设备上的各种浏览器进行了详细介绍,以及这些浏览器的市场占有率、特性支持等。《移动Web手册(双色)》为那些想进入移动Web开发领域的人提供了一些指导性的建议并对移动Web开发的未来进行了展望。 《移动......一起来看看 《移动Web手册》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具