I have developed a golang application (multiplayer game backend) using socket.io.
I am using socket.io plugin made in golang.
Now i want to stream audio between peers.
So do you know any approach for achieving this?
I know socket.io stream library, but how can i use that in/with golang???
kindly help
Socket.io is useful because it is flexible and higher level, but since you want to stream audio data, you might be interested in WebSockets. Socket.io is capable of using the WebSocket transport, but in your case pure WebSockets might be a better solution.
This Medium Post talks about why you might not need Socket.io.
This other Medium Post talks about how to implement audio streaming using WebSockets.
This tutorial and this other tutorial might help you getting started in WebSockets in go.
Related
I'm developing an audio streaming platform like Spotify for a school project. I used Vuejs for the front-end application and implemented an audio player. This is working.
Now I need a way to send audio files from a back-end to my front-end. I now have a micro service called streaming service using Spring Boot and used WebSocktets (STOMP) to make a connection with the front-end. But I see it's mostly used for chat applications or conference call applications..
I read it is heavy to send audio files via REST, because of making connections repeatedly. Which way is the most efficient way to implement this?
Please be specific in your answer since I'm not a advanced developer
I read it is heavy to send audio files via REST, because of making connections repeatedly.
Not really. For something like Spotify, a normal HTTP Progressive stream is sufficient. In this case only one TCP connection is typically made, over which a small handful of ranged HTTP requests will go over.
Web Sockets are only appropriate for cases where you need a bidirectional data flow. In this case, you just have requests and responses, which a normal HTTP request is suitable for.
Usage of regular HTTP also means you can utilize standard CDNs.
I'm little bit confused about bidirectional working of gRPC. And I can't find any good explanation of it. Can somebody say/describe what is the difference between gRPC bidirectional streaming and websockets? Can I create fully functional chat application (server/client) using only gRPC with high load?
I am trying mostly for learning purposes to implement a module similar to SignalR(still a beginner in SignalR) using raw websockets. (I am already very familiar with websockets)
Is there any guide or something that explains what functionality does SignalR have on top of websockets? (so that i know what features i need to implement) ? .
From what i understood it keeps a persistent connection , and can fallback to other protocols if websockets are not supported (long polling ...etc).
I have already checked this video but i need something more in detail.
I had written one article regarding SignalR one year back. It contains SignalR basic information and code example.
Following is the link of it -
https://medium.com/#aparnagadgil/real-time-web-functionality-using-signalr-ba483efcb959
Hope this helps you!
I have already looked at some options such as cellophane but found that the sample app crashes. Also it does way more than just implement socket.io protocol because it uses json and curl. What I am looking for is a simple library in C (not c++, so no boost) which does the encoding and decoding of data using socket.io protocol, so that it can be used with any other library that does network i/o. The purpose is to implement a native client for linux developed in C to talk to node.js server.
Any libraries/solutions that would help is appreciated. Also any documentation on socket.io protocol would help, so that I can look at implementing it.
Thanks.
First of all, is it a nice and successfull idea to use peer 2 peer to broadcast realtime video ? I know that it will make the application scallable and will allow more users to get the real time video without affecting the server much, but are there drawbacks performance-wise and video quality-wise ?
Now the specefic question, my intention is to share realtime video, and then use peer2peer in the webclient level using websockets, are there any libraries that are used for this purpose?
I know that streaming should be better using UDP but the follwing post says that even using websockets (TCP) at 30fps is fast ennough (Video streaming over websockets using JavaScript)
XSockets.NET provides a WebRTC API.
This will provide you a JavaScript API for P2P communication. You can actually have a video chat with 2 or more participants really easy.
If you are a .NET dev you can install the sample from nuget. That sample contains a example of a multivideo chat.
The video will be of high quality, but you can set parameters to get lower resolution if you have low bandwith.
WebRTC works in Chrome and Firefox today (as well as chrome 29 on android). You can try this site with Chrome (not updated for Firefox or mobile) http://browsermeeting.com/
Nuget Package
You can check out IceLink (disclaimer: I work # FM), it'll help you do this.
I've actually built something along these lines for a client of ours, where each successive client becomes a potential "distribution" node. So X clients connect to the main server, and from there, other clients can connect to those clients (provided they have appropriate bandwidth/CPU/etc) for a re-broadcast version. It's sort of a supernode/mesh concept, and it works reasonably well.