Show HN: Gfile, a WebRTC based file transfer utility in Go
github.com
github.com
When I saw the claim "without the need of a third party", it didn't fit with my knowledge of WebRTC so I went spelunking through the code and found that they do indeed use a STUN server[3], in particular google's "stun.l.google.com:19302".
Just want to point out to those who might be relatively new to WebRTC, p2p mechanisms, etc -- it is surprisingly hard for two computers to talk to each other over the wide internet, even in this day and age. Even if you're behind the same router things aren't necessarily straight forward.
[EDIT] - Also note that in the case of TURN, it is up to the application layer to encrypt communications[4].
[0]: https://en.wikipedia.org/wiki/Interactive_Connectivity_Estab...
[1]: https://en.wikipedia.org/wiki/STUN
[2]: https://en.wikipedia.org/wiki/Traversal_Using_Relays_around_...
[3]: https://github.com/Antonito/gfile/blob/v0.1.0/internal/sessi...
[4]: https://stackoverflow.com/questions/23085335/is-webrtc-traff...
Only if both are behind NAT without forwarded ports and even then you can just use services like this[1] if you want to send files/data and it's super easy.
> Even if you're behind the same router things aren't necessarily straight forward.
I don't think this is true for most cases today.
I'm guessing it still depends on STUN and TURN servers?
There's no TURN server specified, and I'm not 100% sure whether the one that's specified there (Google's) does both (so if STUN didn't work, would it fail or attempt TURN?).
Since it's only STUN, and not TURN, the actual transferred data does not go transit through it though.
If you are just learning Golang, then congrats on shipping!
It can be useful if your transmitting data between two different clients on two different networks. In this case, you don't need to open ports on your firewall nor change your network configuration :)
Thank you!
To solve the same problem I've been using another [0] simple silly solution, but security is a concern.
If you think of any feature/improvements, feel free to open a issue/pull request! :)
> It allows to share a file directly between two computers, without the need of a third party.
Can it be done with a single HTML file instead of Go?
You know, which can be hosted anywhere even on Github pages.
I'm planning to work on the SDP stuff at some point. It works well, but sharing two base64 encoded strings isn't very practical :/
They could also be air gapped, both behind NATs and other non-standard topologies. ICE will take care of all the hard problems :)
A simple NC command would do.
Or something like python -m http.server and curl
I have a bunch of servers with no public IPs split between different regions.
Potentially the sender could output a URL that contains the SDP. That way the receiver can either be a CLI or a web browser.
Thanks to Antonito (and their usage of MIT license) I'll fork their code into croc so it can do WebRTC with a secure PAKE channel.
If you're not writing it yourself (WebRTC is super simple, and this tool is basically the absolute bare-bone example of it—make a pipe and transfer something over it), why in the world would you care about what language it is written in beyond whether the language is safe, performant enough, and not a nightmare to execute on the target PC?
If you're not making it, you don't get to pick the tools. Paying just to get decide tools for other people also seems like a really weird thing to do.
In real life, languages are more than tools, but as long as features/performance/behavior is acceptable, it still reduces to an implementation detail.
(also, unless segfaults can be considered features, I don't see why C would get you anything extra.)
The performances used to be far worse, but with the recent improvements on pion/sctp, I felt gfile had become fast enough to be useful to some people.
I was recently playing with a similar thing and used the lib [2]
I'm making it, I'm a dev (but focused on other projects). I want a specific solution that I can use from my projects. That's why I have technical requirements, not functional ones.
This is a new low as far as hatred that I've witnessed.