Hacker News new | ask | show | jobs
by est 2634 days ago
> gfile is a WebRTC based file exchange software.

> 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.

6 comments

I actually did such kind of experiment recently [0]. As a bonus, the users do not have to copy/paste the SDP data manually - instead it is transmitted through sound!

[0] https://ggerganov.github.io/wave-share

That project is really cool!

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 :/

Yup, it can be done! Actually, it's one of my next objectives for it. I started to write a front-end client, with WebAssembly. It's not fully working yet, but you can take a look at it here: https://github.com/Antonito/gfile/tree/master/_client/web
The use case that excites me is transfer between servers/no X11. Just a single binary, no deps to worry about.

They could also be air gapped, both behind NATs and other non-standard topologies. ICE will take care of all the hard problems :)

> transfer between servers

A simple NC command would do.

Or something like python -m http.server and curl

Heh can't tell you how many times I've used that python http server. Sure enough no matter the OS if Python is installed, it gives me the edge if I can access machines behind the same network.
That wouldn’t work if they don’t have a direct connection (my main use case)

I have a bunch of servers with no public IPs split between different regions.

On a server it makes sense if there is no UI involved.

Potentially the sender could output a URL that contains the SDP. That way the receiver can either be a CLI or a web browser.

The page needs to run the appropriate javascript. That is all. Of course a STUN server at the least is required.
There is Go WASM runtime, isn't there?
Yeah, you can compile to WASM since the last few versions of Go (1.10 or 1.11)!