thelazyfox / gortmp

Implement RTMP protocol by golang
MIT License
2 stars 0 forks source link

Smart proxy #6

Open misiek08 opened 10 years ago

misiek08 commented 10 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 :(

It's dupe of issue in master repo.

chacken commented 10 years ago

That's called Multicasting. I don't see why you couldn't, but you'd still have to forward the RTMP commands to the master server to perform handshakes, etc.

misiek08 commented 10 years ago

I use nginx-rtmp-module for now and I think (I just didn't go into it's source code) that it just makes handshakes and all that stuff like for local stream, but only video and audio data are transmitted from source server.

misiek08 commented 10 years ago

Can anyone provide skeleton, first step or event full project? I can pay few-beer price for that, of course MIT license on that code and still source open. I'm going to add http auth code and other, but that's simple. RTMP part is (for now) too hard. I just started with Go, because C and Java take too much nerves, time and lines of code to do anything.

misiek08 commented 10 years ago

I tried the sniffer but it connects too many connections, and I tried to make multicast proxy, but it didn't work. I looked at code from gist: https://gist.github.com/fiorix/9664255 But there's problem with handshake and handling commands for that. I wrote in Go maybe 30-50 lines in my life and I just can't handle array of streams and sending different streams on same Listener/port.