zhangpeihao / gortmp

Implement RTMP protocol by golang
MIT License
523 stars 162 forks source link

Smart proxy #5

Open misiek08 opened 9 years ago

misiek08 commented 9 years ago

Is it possible to make "smart" proxy? If user connects to live stream and proxy have already clients on that stream it won't make new connection to master server but server the same data. So if client 1 connects to live/stream1, proxy connects to master.server.org/live/stream1, then client 2 connects to live/stream1 and proxy just fanouts packets to clients 1 and 2 without making 2nd connection to master server.

Let me know how if it's easy. I'm newbie in Go :(

zhangpeihao commented 9 years ago

FMS has the Edge server to do it.

misiek08 commented 9 years ago

FMS su..... it's not the best in my opinion :)

hy05190134 commented 8 years ago

@zhangpeihao 我看你在 demo 下面简单写了一个 rtmp proxy 的未实现版本,我想了解的是,proxy 的意义是什么?如何实现这样的 proxy? 需要转发 c0, c1, 以及 connect 什么的,那其实类似于识别 客户端发送给服务端的所有命令并做转发?

zhangpeihao commented 8 years ago

proxy应该是可以用的。 有一些做proxy的场景,例如导播,:)

hy05190134 commented 8 years ago

@zhangpeihao 那这个 proxy 只需要转发 c0-c2, 以及 s0-s2 就可以了?

zhangpeihao commented 8 years ago

后面有IO copy啊

hy05190134 commented 8 years ago

@zhangpeihao 我的意思是类似 connect 以及 create_stream 的包都不需要转发,直接走 IO copy 就行了

zhangpeihao commented 8 years ago

不行的,RTMP协议要验证的

hy05190134 commented 8 years ago

@zhangpeihao 但是我看你 demo 下面的 proxy 代码只转发了 handshake

zhangpeihao commented 8 years ago

对,handshake有认证信息