https://github.com/peer-calls/peer-calls Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + GitHub Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions By size + Enterprise + Teams + Startups By industry + Healthcare + Financial services + Manufacturing By use case + CI/CD & Automation + DevOps + DevSecOps * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} peer-calls / peer-calls Public * Notifications You must be signed in to change notification settings * Fork 278 * Star 1.5k Group peer to peer video calls for everyone written in Go and TypeScript peercalls.com License Apache-2.0 license 1.5k stars 278 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 46 * Pull requests 5 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights peer-calls/peer-calls This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master BranchesTags Go to file Code Folders and files Last Last Name Name commit commit message date Latest commit History 1,090 Commits .github .github build build config config deploy deploy res res scripts scripts server server src src types types .dockerignore .dockerignore .drone.yml .drone.yml .editorconfig .editorconfig .eslintignore .eslintignore .eslintrc.yaml .eslintrc.yaml .gitignore .gitignore .gitlab-ci.yml .gitlab-ci.yml .golangci-errcheck-exclude.txt .golangci-errcheck-exclude.txt .golangci.yml .golangci.yml .nvmrc .nvmrc CODE_OF_CONDUCT.md CODE_OF_CONDUCT.md CONTRIBUTING.md CONTRIBUTING.md Dockerfile Dockerfile LICENSE LICENSE Makefile Makefile README.md README.md TODO.md TODO.md docker-compose.yml docker-compose.yml go.mod go.mod go.sum go.sum jest.config.js jest.config.js jest.setup.js jest.setup.js kustomization.yaml kustomization.yaml main.go main.go main_test.go main_test.go package-lock.json package-lock.json package.json package.json transport-node-1.yml transport-node-1.yml transport-node-2.yml transport-node-2.yml tsconfig.json tsconfig.json webpack.common.js webpack.common.js webpack.dev.js webpack.dev.js webpack.prod.js webpack.prod.js View all files Repository files navigation * README * Code of conduct * Apache-2.0 license Peer Calls v4 Peer Calls CI Go Report Card WebRTC peer to peer calls for everyone. See it live in action at peercalls.com. The server has been completely rewriten in Go and all the original functionality works. An optional implementation of a Selective Forwarding Unit (SFU) is available to make Peer Calls consume less bandwith for user video uploads. This wouldn't haven been possible without the awesome pion/webrtc library. The config file format is still YAML, but is different than what was in v3. The v3 source code is available in version-3 branch. Version 4 will no longer be published on NPM since the server is no longer written in NodeJS. What's New in v4 * [*] Core rewritten in Golang. * [*] Selective Forwarding Unit. Can be enabled using NETWORK_TYPE= sfu environment variable. The peercalls.com instance has this enabled. * [*] Ability to change video and audio devices without reconnecting. * [*] Improved toolbar layout. Can be toggled by clicking or tapping. * [*] Multiple videos are now shown in a full-size grid and each can be minimized. * [*] Video cropping can be turned off. * [*] Improved file sending. Users are now able to send files larger than 64 or 256 KB (depends on the browser). * [*] Device names are correctly populated in the dropdown list. * [*] Improved desktop sharing. * [*] Copy invite link to clipboard. Will show as share icon on devices that support it. * [*] Fix: Toolbar icons render correctly on iOS 12 devices. * [*] Fix: Video autoplays. * [*] Fix: Toolbar is no longer visible until call is joined * [*] Fix: Add warning when using an unsupported browser * [*] Fix: Add warning when JavaScript is disabled TODO for Selective Forwarding Unit * [*] Support dynamic adding and removing of streams * [*] Support RTCP packet Picture Loss Indicator (PLI) * [*] Support RTCP packet Receiver Estimated Maximum Bitrate (REMB) * [*] Add handling of other RTCP packets besides NACK, PLI and REMB * [*] Add JitterBuffer (experimental, currently without congestion control) * [*] Support multiple Peer Calls nodes when using SFU * [*] Add support for passive ICE TCP candidates * [*] End-to-End Encryption (E2EE) using Insertable Streams. See # 142. Requirements for Development * Node.js 18.13 * Go 1.19.5 Alternatively, Docker can be used to run Peer Calls. Stack Backend * Golang * pion/webrtc * github.com/go-chi/chi * nhooyr.io/websocket See go.mod for more information Frontend * React * Redux * TypeScript (since peer-calls v2.1.0) See package.json for more information. Installation & Running Download Release Head to Releases and download a precompiled version. Currently the binaries for the following systems are built automatically: * linux amd64 * linux arm * darwin (macOS) amd64 * windows amd64 Deploying onto Kubernetes The root of this repository contains a kustomization.yaml, allowing anyone to patch the manifests found within the deploy/ directory. To deploy the manifests without applying any patches, pass the URL to kubectl: kubectl apply -k github.com/peer-calls/peer-calls Using Docker The automated builds on Docker Hub now require a subscription, and approval is required even for open source projects. We recently switched to using GitHub Container Registry instead: Use the ghcr.io/peer-calls/peer-calls image: docker run --rm -it -p 3000:3000 ghcr.io/peer-calls/peer-calls:latest Building from Source git clone https://github.com/peer-calls/peer-calls.git cd peer-calls npm install # for production npm run build npm run build:go:linux # for development npm run start Building Docker Image git clone https://github.com/peer-calls/peer-calls cd peer-calls docker build -t peer-calls . docker run --rm -it -p 3000:3000 peer-calls Configuration Environment variables Variable Type Description Default Enables or PEERCALLS_LOG csv disables logging -sdp,-ws,-nack,-rtp,-rtcp,-pion:*:trace,-pion:*:debug,-pion:*:info,* for certain modules When set to a non-empty value, PEERCALLS_FS string use the path to find resource files PEERCALLS_BASE_URL string Base URL of the application PEERCALLS_BIND_HOST string IP to listen to 0.0.0.0 PEERCALLS_BIND_PORT int Port to listen to 3000 Path to TLS PEM PEERCALLS_TLS_CERT string certificate. If set will enable TLS Path to TLS PEM PEERCALLS_TLS_KEY string cert key. If set will enable TLS PEERCALLS_STORE_TYPE string Can be memory or memory redis PEERCALLS_STORE_REDIS_HOST string Hostname of Redis server PEERCALLS_STORE_REDIS_PORT int Port of Redis server Prefix for Redis PEERCALLS_STORE_REDIS_PREFIX string keys. Suggestion: peercalls Can be mesh or sfu. Setting to PEERCALLS_NETWORK_TYPE string SFU will make the mesh server the main peer List of interfaces to use for ICE PEERCALLS_NETWORK_SFU_INTERFACES csv candidates, uses all available when empty Set to true to PEERCALLS_NETWORK_SFU_JITTER_BUFFER bool enable the use of false Jitter Buffer PEERCALLS_NETWORK_SFU_PROTOCOLS csv Can be udp4, udp6, udp4,udp6 tcp4 or tcp6 ICE TCP bind PEERCALLS_NETWORK_SFU_TCP_BIND_ADDR string address. By default listens on all interfaces. ICE TCP listen PEERCALLS_NETWORK_SFU_TCP_LISTEN_PORT int port. By default 0 uses a random port. When set, will listen for PEERCALLS_NETWORK_SFU_TRANSPORT_LISTEN_ADDR string external RTP, Data and Metadata UDP streams When set, will PEERCALLS_NETWORK_SFU_TRANSPORT_NODES csv transmit media and data to designated host:port(s). Defines ICE UDP PEERCALLS_NETWORK_SFU_UDP_PORT_MIN int range start to use 0 for UDP host candidates. Defines ICE UDP PEERCALLS_NETWORK_SFU_UDP_PORT_MAX int range end to use 0 for UDP host candidates. PEERCALLS_ICE_SERVER_URLS csv List of ICE Server URLs Can be empty or PEERCALLS_ICE_SERVER_AUTH_TYPE string secret for coturn static-auth-secret config option. PEERCALLS_ICE_SERVER_SECRET string Secret for coturn PEERCALLS_ICE_SERVER_USERNAME string Username for coturn Access token for PEERCALLS_PROMETHEUS_ACCESS_TOKEN string prometheus / metrics URL PEERCALLS_FRONTEND_ENCODED_INSERTABLE_STREAMS bool Enable insertable false streams The default ICE servers in use are: * stun:stun.l.google.com:19302 * stun:global.stun.twilio.com:3478?transport=udp Only a single ICE server can be defined via environment variables. To define more use a YAML config file. To load a config file, use the -c /path/to/config.yml command line argument. See config/types.go for configuration types. Example: base_url: '' bind_host: '0.0.0.0' bind_port: 3005 ice_servers: - urls: - 'stun:stun.l.google.com:19302' - urls: - 'stun:global.stun.twilio.com:3478?transport=udp' #- urls: # - 'turn:coturn.mydomain.com' # auth_type: secret # auth_secret: # username: "peercalls" # secret: "some-static-secret" # tls: # cert: test.pem # key: test.key store: type: memory # type: redis # redis: # host: localhost # port: 6379 # prefix: peercalls network: type: mesh # type: sfu # sfu: # interfaces: # - eth0 prometheus: access_token: "mytoken" frontend: encodedInsertableStreams: false Prometheus /metrics URL will not be accessible without an access token set. The access token can be provided by either: * Setting Authorization header to Bearer mytoken, or * Providing the access token as a query string: /metrics? access_token=mytoken To access the server, go to http://localhost:3000. Accessing From Network Most browsers will prevent access to user media devices if the application is accessed from the network (not via 127.0.0.1). If you wish to test your mobile devices, you'll have to enable TLS by setting the PEERCALLS_TLS_CERT and PEERCALLS_TLS_KEY environment variables. To generate a self-signed certificate you can use: openssl req -nodes -x509 -newkey rsa:4096 -keyout key.pem -subj "/C=US/ST=Oregon/L=Portland/O=Company Name/OU=Org/CN=example.com" -out cert.pem -days 365 Replace example.com with your server's hostname. Multiple Instances and Redis Redis can be used to allow users connected to different instances to connect. The following needs to be added to config.yaml to enable Redis: store: type: redis redis: host: redis-host # redis host port: 6379 # redis port prefix: peercalls # all instances must use the same prefix Logging By default, Peer Calls server will log only basic information. Client-side logging is disabled by default. Server-side logs can be configured via the PEERCALLS_LOG environment variable. Setting it to * will enable all server-side logging: * PEERCALLS_LOG=* Client-side logs can be configured via localStorage.DEBUG and localStorage.LOG variables: * Setting localStorage.log=1 enables logging of Redux actions and state changes * Setting localStorage.debug=peercalls,peercalls:* enables all other client-side logging Development Below are some common scripts used for development: npm start build all resources and start the server. npm run build build all client-side resources. npm run start:server start the server npm run js:watch build and watch resources npm test run all client-side tests. go test ./... run all server tests npm run ci run all linting, tests and build the client-side Browser Support Tested on Firefox and Chrome, including mobile versions. Also works on Safari and iOS since version 11. Does not work on Microsoft Edge because they do not support DataChannels yet. For more details, see here: * http://caniuse.com/#feat=rtcpeerconnection * http://caniuse.com/#search=getUserMedia In Firefox, it might be useful to use about:webrtc to debug connection issues. In Chrome, use about:webrtc-internals. When experiencing connection issues, the first thing to try is to have all peers to use the same browser. Epheremal UDP Ports for ICE The UDP port range can be defined for opening epheremal ports. These ports will be used for generating UDP host ICE candidates. It is recommended to enable these UDP ports when ICE TCP is enabled, because the priority of TCP host candidates will be higher than srflx /prflx candidates, as such TCP will be used even though UDP connectivity might be possible. ICE TCP Peer Calls supports ICE over TCP as described in RFC6544. Currently only passive ICE candidates are supported. This means that users whose ISPs or corporate firewalls block UDP packets can use TCP to connect to the SFU. In most scenarios, this removes the need to use a TURN server, but this functionality is currently experimental and is not enabled by default. Add the tcp4 and tcp6 to your PEERCALLS_NETWORK_SFU_PROTOCOLS to enable support for ICE TCP: PEERCALLS_NETWORK_TYPE=sfu PEERCALLS_NETWORK_SFU_PROTOCOLS=`udp4,udp6,tcp4,tcp6` peer-calls To test this functionality, udp4 and udp6 network types should be omitted: PEERCALLS_NETWORK_TYPE=sfu PEERCALLS_NETWORK_SFU_PROTOCOLS=`tcp4,tcp6` peer-calls Please note that in production the PEERCALLS_NETWORK_SFU_TCP_LISTEN_PORT should be specified and external TCP access allowed through the server firewall. TURN Server When a direct connection cannot be established, it might be help to use a TURN server. The peercalls.com instance is configured to use a TURN server and it can be used for testing. However, the server bandwidth there is not unlimited. Here are the steps to install a TURN server on Ubuntu/Debian Linux: sudo apt install coturn Use the following configuration as a template for /etc/ turnserver.conf: lt-cred-mech use-auth-secret static-auth-secret=p4ssw0rd realm=example.com total-quota=300 cert=/etc/letsencrypt/live/rtc.example.com/fullchain.pem pkey=/etc/letsencrypt/live/rtc.example.com/privkey.pem log-file=/dev/stdout no-multicast-peers proc-user=turnserver proc-group=turnserver Change the p4ssw0rd, realm and paths to server certificates. Use the following configuration for Peer Calls: iceServers: - urls: - 'turn:rtc.example.com' auth_type: secret auth_secret: username: 'example' secret: 'p4ssw0rd' Finally, enable and start the coturn service: sudo systemctl enable coturn sudo systemctl start coturn Contributing See Contributing section. If you encounter a bug, please open a new issue! Support The development of Peer Calls is sponsored by rondomoon. If you'd like enterprise on-site support or become a sponsor, please contact hello@rondomoon.com. License Apache 2.0 About Group peer to peer video calls for everyone written in Go and TypeScript peercalls.com Topics conference webrtc peer-to-peer p2p sfu video-call peer-calls peer-call Resources Readme License Apache-2.0 license Code of conduct Code of conduct Activity Custom properties Stars 1.5k stars Watchers 42 watching Forks 278 forks Report repository Releases 44 PeerCalls v4.2.7 Latest Apr 14, 2024 + 43 releases Packages 0 Contributors 12 * @jeremija * @excelwebzone * @yedpodtrzitko * @moosh3 * @Luzifer * @khalaharvi * @bennydtown * @vikaskedia * @mikehow1984 * @ham3r * @lil5 * @danielxvu Languages * Go 58.7% * TypeScript 37.8% * Sass 2.7% * JavaScript 0.3% * HTML 0.2% * Dockerfile 0.1% * Other 0.2% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.