Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Sean-Der/pion-webrtc-shared-socket
Demonstration of using Pion WebRTC with a shared socket
https://github.com/Sean-Der/pion-webrtc-shared-socket
Last synced: 3 months ago
JSON representation
Demonstration of using Pion WebRTC with a shared socket
- Host: GitHub
- URL: https://github.com/Sean-Der/pion-webrtc-shared-socket
- Owner: Sean-Der
- Created: 2021-10-26T18:56:14.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-26T19:29:25.000Z (over 3 years ago)
- Last Synced: 2024-06-11T01:19:49.705Z (8 months ago)
- Language: Go
- Size: 8.79 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-pion - sean-der/pion-webrtc-shared-socket - Use Pion WebRTC with a shared socket. Allows non-WebRTC and WebRTC over the same socket. (DataChannel)
README
# pion-webrtc-shared-socket
This example demonstrates how Pion WebRTC can use an already listening UDP socket. On startup we listen on UDP Socket 8000.
We wrap this socket in a `sharedUDPConn`, this `sharedUDPConn` drops `ReadFrom` that don't appear to be WebRTC traffic.### Running
* `go install github.com/sean-der/pion-webrtc-shared-socket@latest`
* `~/go/bin/pion-webrtc-shared-socket`
* Open `http://localhost:8080`In the command line you should see
```
2021/10/26 14:42:29 Open http://localhost:8080 to access
Peer Connection State has changed: connected
```This means that the PeerConnection has started and connected succesfully. Now attempt to send non-WebRTC traffic to the process.
* `echo 'Testing' | nc -q 1 -u localhost 800`
This will be printed in the terminal like so
```
Dropped packet that doesn't appear to be WebRTC: Testing
```