Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anshuthopsee/webrtc-file-sharing
A simple experiment with WebRTC by using it to transfer files, peer to peer with the help of a custom WebSocket server to do signalling between the peers.
https://github.com/anshuthopsee/webrtc-file-sharing
file-sharing file-transfer peer-to-peer signaling-server signalling webrtc websocket
Last synced: 4 months ago
JSON representation
A simple experiment with WebRTC by using it to transfer files, peer to peer with the help of a custom WebSocket server to do signalling between the peers.
- Host: GitHub
- URL: https://github.com/anshuthopsee/webrtc-file-sharing
- Owner: anshuthopsee
- License: mit
- Created: 2023-03-13T23:53:21.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-15T10:33:55.000Z (8 months ago)
- Last Synced: 2024-06-15T11:44:59.186Z (8 months ago)
- Topics: file-sharing, file-transfer, peer-to-peer, signaling-server, signalling, webrtc, websocket
- Language: JavaScript
- Homepage:
- Size: 1.91 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WebRTC-File-Sharing
A simple experiment with WebRTC by using it to transfer files, peer to peer with the help of a custom WebSocket server to do signalling between the peers. Chrome-to-Chrome, Firefox-to-Firefox and also cross-browser transfers tested.
You can locally host the website and use it to share files between your devices (Devices need to be on the same Wi-Fi network as the server).
To access the site from another device, which is not your server, find out your IP Address and use that to access the site. Also in the __index.js__ file, change the WebSocket connection url with your IP Address, like so.
```javascript
const ws = new WebSocket(`ws://${IP_ADDRESS}:8895`);
```
## Demo![File sharing demo](demo/file_sharing.gif)
## Dependencies
- websocket
```
npm i websocket
```
## References
- https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API
- https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Signaling_and_video_calling
- https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Using_data_channels