Giter Site home page Giter Site logo

a-wing / filegogo Goto Github PK

View Code? Open in Web Editor NEW
277.0 277.0 30.0 4.53 MB

A file transfer tool that can be used in the browser webrtc p2p

Home Page: https://send.22333.fun

License: MIT License

Go 50.31% Makefile 0.84% HTML 0.83% CSS 0.33% TypeScript 47.22% Dockerfile 0.47%
file-sharing p2p webrtc

filegogo's Introduction

Filegogo
Filegogo

send.22333.fun

A file transfer tool that can be used in the browser webrtc p2p

Github Actions Go Report Card GitHub Release License

Demo.gif

Deploy on your self server

docker run -p 8080:8080 ghcr.io/a-wing/filegogo:latest server

Architecture

filegogo-arch

Components

  • app
    • server
    • webapp
    • client-cli (current, have many problems)
  • lib
    • libfgg.js (only browser)
    • libfgg.go
    • libfgg.rs

Build && Install

make

Run Development

Webapp

npm install

# frontend
# Default Listen port: 3000
# Auto Proxy port: 8080
npm run dev

Server

# Default Listen port: 8080
go run ./main.go server

Client

run cli client. For example:

# send command
go run ./main.go send -s http://localhost:8080/6666 <file>

# recv command
go run ./main.go recv -s http://localhost:8080/6666 <file>

Config

Reference iceServer config

Built-in turn server

# Enable Built-in turn server
[turn]

# if no set, use random user
user = "filegogo:filegogo"

realm = "filegogo"
listen = "0.0.0.0:3478"

# Public ip
# if aws, aliyun
publicIP = "0.0.0.0"
relayMinPort = 49160
relayMaxPort = 49200

iceServer Use Other

For example: coturn

Docker Deployment Coturn

docker run -d --network=host --name=coturn coturn/coturn:alpine \
           -n --log-file=stdout \
           --min-port=49160 --max-port=49200 \
           --lt-cred-mech --fingerprint \
           --no-multicast-peers --no-cli \
           --no-tlsv1 --no-tlsv1_1 \
           --realm=filegogo \
           --user=filegogo:filegogo \
           --external-ip='$(detect-external-ip)' \
           --relay-ip='$(detect-external-ip)' \
           --listening-ip='$(detect-external-ip)' \
           --listening-device=eth0

Test Deployment

# Test stun
turnutils_stunclient cn.22333.fun
turnutils_stunclient stun.22333.fun

# Test turn
turnutils_uclient -u filegogo -w filegogo -y cn.22333.fun
turnutils_uclient -u filegogo -w filegogo -y turn.22333.fun

Package Manager Deployment

apt install coturn
# /etc/turnserver.conf

listening-ip={YOUR_IP_ADDRESS}
relay-ip={YOUR_IP_ADDRESS}

# Public ip
# if aws, aliyun
external-ip={YOUR_IP_ADDRESS}

fingerprint
lt-cred-mech
user=filegogo:filegogo
realm=filegogo

Acknowledgments

filegogo's People

Contributors

a-wing avatar dependabot[bot] avatar eaglexmw-gmail avatar emptyteeth avatar kimidaisuki22 avatar s1eke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

filegogo's Issues

Error when sending file via client

I am able to transfer files via the webapp however when using client I get the following error:

$ go run ./main.go send -s http://192.168.1.10:3000/5451 /home/andy//Videos/20191006_142104.mp4
panic: invalid character '<' looking for beginning of value

goroutine 1 [running]:
filegogo/client.(*Client).overrideServer(0xc00000e798)
/home/andy/code/filegogo/client/client.go:83 +0x251
filegogo/client.(*Client).Send(0xc00000e798, {0x1d, 0xc0000efcb0}, {0xc0001b9110, 0x1, 0x1})
/home/andy/code/filegogo/client/client.go:104 +0x10e
filegogo/cmd.init.1.func2(0xc0001da0c0)
/home/andy/code/filegogo/cmd/send.go:28 +0xed
github.com/urfave/cli/v2.(*Command).Run(0xc00018d560, 0xc000091f80)
/home/andy/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:163 +0x64a
github.com/urfave/cli/v2.(*App).RunContext(0x1000440, {0xc4db10, 0xc000024110}, {0xc0000200a0, 0x5, 0x5})
/home/andy/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:313 +0x81e
github.com/urfave/cli/v2.(*App).Run(...)
/home/andy/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:224
filegogo/cmd.Execute()
/home/andy/code/filegogo/cmd/cmd.go:43 +0x45
main.main()
/home/andy/code/filegogo/main.go:6 +0x17

Failed downgrade use http

look like filefox send

  • support tmp file storage
  • http server interface, support curl -F "f=@filename" send file
  • current auto downgrade webrtc > websocket, after webrtc > websocket > http

Is it really file transfer tool based on webRTC ?

Hi,
I have tested the user-end functionality. It involves a simple process of uploading files and downloading them through direct links. Could you please provide more details? I'm actually searching for a peer-to-peer file sharing platform

Here is my idea

First, I'll upload a file to an online server (FileManager), and it will generate a unique URL for that file. This URL will be shared on any website / social media ETC

When the first user decides to download the file, it will be retrieved directly from the server since only one peer is involved.

As more users come in to download the file, the number of peers increases. For instance, when the second user arrives, the file will have two peers: the server and the first user who downloaded it. This means the second user will download the file from both the server and the first user.

Similarly, when a third user arrives, there will be three peers: the server, the first user, and the second user. This setup grows with more users, resulting in multiple peers for each download.

So if no one is downloading, MY server will always be available as the default peer. This idea is to make shared file peer active for a lifetime

[Question] webrtc 如何避免或减少加密的开销, 因为wireguard会主导加密

我在做一个关于 wireguard over webrtc 的项目 wgortc, 其中遇到了性能问题:

速度 区别
wiireguard-kernel 800M/s -
wireguard-go 270M/s -
tailscale 600M/s 仅使用了 ICE 来发现端口, 比 wg-go 快这么多, 应该是用了内核模块
wgortc 55M/s webrtc 单 data channel, 换成"媒体通信"会不会好点?

谢谢你的查看


更新: 修改 mtu 为 1120 (1200-80) 后速度由 40M/s 提升到了 55M/s (1200是webrtc默认选择的mtu)

websocket reconnect

Websocket reconnect is required when some abnormal conditions occur in the network

bug提交

修改filegogo.toml配置文件中http端口为80,然后开启turn功能,运行后实际监听的端口会变为8080,80并未生效。不开启turn功能,修改端口为80是成功的

CI Browser test

webapp use github action auto Browser test

  • Chrome
  • Firefox
  • Edge
  • Safari

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.