Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

gfile

> 编程语言
Open source

Direct file transfer over WebRTC

761 stars0 likes2 views
WebsiteGitHub

About

Direct file transfer over WebRTC

GFile

gfile is a WebRTC-based file exchange tool.

It lets you share a file directly between two computers, without the need of a third party.

Note

This project is still in its early stage.

How does it work ?

The STUN server is only used to help the two clients find each other through NAT. The data you transfer with gfile does not transit through it.

More information here

For wire-format and session-protocol details, see PROTOCOL.md.

STUN configuration

gfile defaults to Google's public STUN server (stun.l.google.com:19302). You can override this with --stun:

bash
# Use a specific STUN server
gfile --stun stun.cloudflare.com:3478 send -f filename

# Use multiple STUN servers (comma-separated)
gfile --stun stun.l.google.com:19302,stun.cloudflare.com:3478 send -f filename

# Disable STUN entirely — host/mDNS candidates only (LAN use)
gfile --stun="" send -f filename

mDNS

By default gfile advertises host ICE candidates as .local mDNS hostnames instead of raw LAN IPs, matching modern browser behavior. This keeps your internal network topology out of the SDP you paste around, and is enough for a LAN transfer even with --stun="".

Disable it if a peer on the other side cannot resolve mDNS:

bash
gfile --mdns=false send -f filename

Usage

Sender

bash
gfile send --file filename
  • Run the command
  • A compact encoded SDP will appear, send it to the remote client
  • Follow the instructions to send the client's SDP to your process
  • The file transfer should start

Pass --connections N (1..16) to open N parallel peer connections. The default is 1. Higher values can improve throughput on high-latency or high-bandwidth links — see PROTOCOL.md.

Receiver

bash
# SDP being the compact encoded SDP gotten from the other client
echo "$SDP" | gfile receive -o filename
  • Pipe the other client's SDP to gfile
  • A compact encoded SDP will appear, send it to the remote client
  • The file transfer should start

Benchmark

gfile can benchmark the network speed between two clients (one sender, one receiver) with the bench command. The SDP exchange works the same as in send / receive.

This feature is still an experiment.

bash
# Run as 'sender'
gfile bench -s

# Run as 'receiver'
echo "$SDP" |  gfile bench

Debug

For more verbose output, set the logging level via the GFILE_LOG environment variable.

Example: export GFILE_LOG="TRACE" See function setupLogger in main.go for more information

Contributors

  • Antoine Baché (https://github.com/Antonito) Original author

Special thanks to Sean DuBois for his help with pion/webrtc and Yutaka Takeda for his work on pion/sctp

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gofile-sharinggogolangpeer-to-peer

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言