Hi,
Go has pretty good support for WebSockets. There are at least two usable backends packages:
And there's a working, tested wrapper for the WebSocket JavaScript API in the browser:
Combined together, it's possible to establish an effectively-TCP bidirectional connection between Go (or JavaScript) code in the browser and Go code in backend server.
Now, TCP connections are great, but there are situations where you really want a less reliable but more performant UDP transport. Some examples include sending real-time video/audio, or latest player positions, etc.
---
Anyway, in my pursuit of being able to achieve more cool things with Go (both in the backend and frontend), I want to be able to use RTCDataChannel to have UDP-like connections between backend and frontend.
On that note, I wanted to inquire on the status of WebRTC/RTCDataChannel and Go. Has anyone done this before? Is anyone interested in this? What are some existing relevant/useful packages, if any? Has anyone tested/used such packages and can vouch they work?
Here are a few things I've found so far, but I haven't had a chance to try these yet:
-
https://godoc.org/github.com/fd/webrtc - seems to be a cgo-based package that wraps around the C++ library at
webrtc.googlecode.com. In the long run I would prefer a pure Go library but cgo is better than nothing. Haven't tried it yet, but this is probably first thing I'll try. Last update 9 months ago.
Please share anything that might be helpful here, or if you're also interested in Go + WebRTC. Thanks!