<p>Hey, so I am looking to make a video streaming application that will basically allow you to live stream video files from one device to another. In essence, the application is very similar to Plex media server, with some differences.</p>
<p>I am sorry if this is less of a Go question, and more of a general programming question, I didn't really know where to post, and since I am writing in Go, thought I might post here.</p>
<p>So the main difference I want in my application is that I want this application to work over the internet without the user having to port forward. This is the only requirement I have for the application.</p>
<p>So far the architecture I have set up is as follows. There will be three components: the file server, the intermediate server, and the client. For maximum performance, p2p via UDP will be prioritized. Basically the file server and the client determine their public IP and port via the use of STUN servers. The file server lets the intermediate server know it's public IP and port. When the client starts up, it queries the intermediate server for the IP/port of the server along with other info like what files are available. Then the client initiates communication directly with the server over UDP. In terms of how the file is streamed, I am not sure how to go about it. The idea I have is that I will have to write my own protocol for splitting up the file and sending it over in pieces and then having acknowledgements sent back, and having the streamed on the client. Now UDP hole punching (method for p2p comm described above) doesn't always work. So as back up, I will have the data go through the intermediate server via TCP.</p>
<p>Now my main question is I don't know if this is the right approach. Because this is UDP, I can't implement the client as a web app (since UDP isn't available in browsers due to security). So my current plan is to implement the client as desktop app in Javascript (via Electron). I have also seen a lot of examples that deal with video streaming in Go use the http module instead. This could definitely solve the client issue allowing me to implement it as a website and I wouldn't have to come up with my own method of streaming the file, but I don't know how to incorporate http communication without needing port forwarding and I don't even know if its possible. All my research about the STUN protocol only seems to mention pure UDP and TCP. But Http is built on TCP so I am not sure...</p>
<p>Any advice is welcome and feel free to correct me If I got something wrong. Thanks.</p>
<hr/>**评论:**<br/><br/>funny_falcon: <pre><p>MPEG-DASH ?</p></pre>Probotect0r: <pre><p>Hmm, so this is another good HTTP option. I did read through the similar HLS protocol by Apple, which got me thinking more about http. My problem is now how to implement that using the STUN method I described.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传