{"id":26400655,"url":"https://github.com/priyangsubanerjee/webrtc-file-transfer","last_synced_at":"2025-06-27T02:36:22.451Z","repository":{"id":140274605,"uuid":"472643345","full_name":"priyangsubanerjee/webrtc-file-transfer","owner":"priyangsubanerjee","description":"Hey there amazing people! This repository holds all the most authentic way, for transferring files (images, video, pdf, etc) over WebRTC datachannels.","archived":false,"fork":false,"pushed_at":"2024-02-29T22:14:57.000Z","size":1881,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T10:38:13.293Z","etag":null,"topics":["datachannel","file-sharing","files","fileupload","signalling-server","turn-based","webrtc"],"latest_commit_sha":null,"homepage":"https://playgroundrtc.vercel.app/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/priyangsubanerjee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-22T06:38:46.000Z","updated_at":"2024-12-21T12:07:40.000Z","dependencies_parsed_at":"2024-02-29T22:48:50.145Z","dependency_job_id":null,"html_url":"https://github.com/priyangsubanerjee/webrtc-file-transfer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/priyangsubanerjee/webrtc-file-transfer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyangsubanerjee%2Fwebrtc-file-transfer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyangsubanerjee%2Fwebrtc-file-transfer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyangsubanerjee%2Fwebrtc-file-transfer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyangsubanerjee%2Fwebrtc-file-transfer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/priyangsubanerjee","download_url":"https://codeload.github.com/priyangsubanerjee/webrtc-file-transfer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priyangsubanerjee%2Fwebrtc-file-transfer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262179039,"owners_count":23271156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datachannel","file-sharing","files","fileupload","signalling-server","turn-based","webrtc"],"created_at":"2025-03-17T14:36:20.695Z","updated_at":"2025-06-27T02:36:22.416Z","avatar_url":"https://github.com/priyangsubanerjee.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Peer-to-peer communication\n\nHey there amazing people! This repository holds all the most authentic way, for transferring files (images, video, pdf, etc) over WebRTC datachannels.\n\n## Previous knowledge\n\nFrom the last few months I have been working with WebRTC live streams \u0026 one-to-one chat's. But as soon as it comes to file transfer, the system used to crash.\n\n### Reasons for system crash:\n- dataChhannel.BufferedAmount() get's full.\n\n### Solution:\n\n- We need to implement a callback listener to listen when the dataChannel bufferedAmount decreases below 16Kib\n\n```bash\nif (dataChannel.bufferedAmount \u003e dataChannel.bufferedAmountLowThreshold) {\n    dataChannel.onbufferedamountlow = () =\u003e {\n        dataChannel.onbufferedamountlow = null;\n        send();\n    };\n    return;\n}\n```\n\n## Run Locally\n\nClone the project\n\n```bash\n  git clone https://link-to-project\n```\n\nGo to the project directory\n\n```bash\n  cd my-project\n```\n\nInstall dependencies\n\n```bash\n  npm install\n```\n\nStart the server\n\n```bash\n  npm start \n```\n\nThe defauly `port` for the express server is `3000`. Visit http://localhost:3000 to view it on browser.\n\n\n## Establishing Connection\n\nTo establish connection between two peer's whether on same network or on different networks, follow the steps mentioned below:\n\n`Suppose:` 👨‍🎓 This is George `\u0026` 🙋‍♀️ This is Anna. Let George intiate the connection with Anna, later they can transfer files to each other.\n\n- `George: ` Open http://localhost:3000 after executing `npm start` in his machine.\n-  `Anna: ` Open http://localhost:3000 after executing `npm start` in her machine.\n- `George: ` Click on `Create Local Offer` and copy the text i'e automatically generated. Now pass this text to Anna via `WhatsApp` or `Telegram` (Note: `WhatsApp`/`Telegram` are behaving as our signaling server as of now.)\n- `Anna: ` Copy the text passed by george and past it inside `Remote Offer` text box, then click on `Connect`. Now you are gonna see some text automatically generated inside your `Local Offer` text box. Copy that \u0026 pass it to George.\n- `George: ` Copy the text passed by Anna and paste it under your `Remote Offer` text box, and click on `Connect`.\n\nIf the connecton above was successfull, the the status text above will change to `Connected to peer`.\n\n`Note:` In future we will use WebSockets which will work as signalling server and we will get rid of all this text passing heck.\n\n## Sending files\n\nFile transfer with WebRTC can be bi-directional. To send files to your peer:\n- Click on choose file button, choose the file you want to send, and boom the file has been sent to your peer.\n- Transfer speed will depend on both of your bandwidths.\n- If you are behind a `NAT` then transfer speeds can really decrease, becasue `TURN` servers used in this project are not the best.\n\n## Protocols\n- SDP (Session Description Protocol)\n\n## Alternatives\n- Building an SFU and transfer files over it.\n- Check [EasyFi Db](https://github.com/priyangsubanerjee/easyfi-db) for more information.\n## Authors\n\n- 👔 [@priyangsubanerjee](https://www.github.com/priyangsubanerjee)\n\n\n## Features\n\n- 🔑 No API key is required to upload a file.\n- 💰 Uploads are completely free as of now.\n- 📱 Send large files easily.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpriyangsubanerjee%2Fwebrtc-file-transfer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpriyangsubanerjee%2Fwebrtc-file-transfer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpriyangsubanerjee%2Fwebrtc-file-transfer/lists"}