{"id":13607839,"url":"https://github.com/peer-calls/peer-calls","last_synced_at":"2025-05-15T10:03:27.214Z","repository":{"id":40455905,"uuid":"55187676","full_name":"peer-calls/peer-calls","owner":"peer-calls","description":"Group peer to peer video calls for everyone written in Go and TypeScript","archived":false,"fork":false,"pushed_at":"2024-06-07T01:16:58.000Z","size":4559,"stargazers_count":1830,"open_issues_count":51,"forks_count":294,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-04-14T16:53:47.592Z","etag":null,"topics":["conference","p2p","peer-call","peer-calls","peer-to-peer","sfu","video-call","webrtc"],"latest_commit_sha":null,"homepage":"https://peercalls.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peer-calls.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2016-03-31T22:41:02.000Z","updated_at":"2025-04-13T04:21:05.000Z","dependencies_parsed_at":"2023-02-13T23:31:35.530Z","dependency_job_id":"2ff97e43-8b32-4075-ab09-ee2e69fea357","html_url":"https://github.com/peer-calls/peer-calls","commit_stats":{"total_commits":1041,"total_committers":14,"mean_commits":74.35714285714286,"dds":0.05859750240153694,"last_synced_commit":"d43abf6538de326910661427f76304a1e08a2330"},"previous_names":["jeremija/peer-calls"],"tags_count":93,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peer-calls%2Fpeer-calls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peer-calls%2Fpeer-calls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peer-calls%2Fpeer-calls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peer-calls%2Fpeer-calls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peer-calls","download_url":"https://codeload.github.com/peer-calls/peer-calls/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319716,"owners_count":22051072,"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":["conference","p2p","peer-call","peer-calls","peer-to-peer","sfu","video-call","webrtc"],"created_at":"2024-08-01T19:01:22.049Z","updated_at":"2025-05-15T10:03:22.158Z","avatar_url":"https://github.com/peer-calls.png","language":"Go","funding_links":[],"categories":["Go","p2p","webrtc","DataChannel"],"sub_categories":[],"readme":"# Peer Calls v4\n\n![Peer Calls CI](https://github.com/peer-calls/peer-calls/workflows/Peer%20Calls%20CI/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/peer-calls/peer-calls)](https://goreportcard.com/report/github.com/peer-calls/peer-calls)\n\nWebRTC peer to peer calls for everyone. See it live in action at\n[peercalls.com][peer-calls].\n\n[peer-calls]: https://peercalls.com\n\nThe server has been completely rewriten in Go and all the original\nfunctionality works. An optional implementation of a Selective Forwarding Unit\n(SFU) is available to make Peer Calls consume less bandwith for user video\nuploads. This wouldn't haven been possible without the awesome\n[pion/webrtc][pion] library.\n\n[pion]: https://github.com/pion/webrtc\n\nThe config file format is still YAML, but is different than what was in v3. The\nv3 source code is available in `version-3` branch.  Version 4 will no longer be\npublished on NPM since the server is no longer written in NodeJS.\n\n# What's New in v4\n\n- [x] Core rewritten in Golang.\n- [x] Selective Forwarding Unit. Can be enabled using `NETWORK_TYPE=sfu` environment variable. The [peercalls.com][peer-calls] instance has this enabled.\n- [x] Ability to change video and audio devices without reconnecting.\n- [x] Improved toolbar layout. Can be toggled by clicking or tapping.\n- [x] Multiple videos are now shown in a full-size grid and each can be minimized.\n- [x] Video cropping can be turned off.\n- [x] Improved file sending. Users are now able to send files larger than 64 or 256 KB (depends on the browser).\n- [x] Device names are correctly populated in the dropdown list.\n- [x] Improved desktop sharing.\n- [x] Copy invite link to clipboard. Will show as share icon on devices that support it.\n- [x] Fix: Toolbar icons render correctly on iOS 12 devices.\n- [x] Fix: Video autoplays.\n- [x] Fix: Toolbar is no longer visible until call is joined\n- [x] Fix: Add warning when using an unsupported browser\n- [x] Fix: Add warning when JavaScript is disabled\n\n## TODO for Selective Forwarding Unit\n\n- [x] Support dynamic adding and removing of streams\n- [x] Support RTCP packet Picture Loss Indicator (PLI)\n- [x] Support RTCP packet Receiver Estimated Maximum Bitrate (REMB)\n- [x] Add handling of other RTCP packets besides NACK, PLI and REMB\n- [x] Add JitterBuffer (experimental, currently without congestion control)\n- [x] Support multiple Peer Calls nodes when using SFU\n- [x] Add support for passive ICE TCP candidates\n- [x] End-to-End Encryption (E2EE) using Insertable Streams. See [#142](https://github.com/peer-calls/peer-calls/pull/142).\n\n# Requirements for Development\n\n - [Node.js 18.13][node]\n - [Go 1.19.5][go]\n\nAlternatively, Docker  can be used to run Peer Calls.\n\n[node]: https://nodejs.org\n[go]: https://golang.org/\n\n# Stack\n\n## Backend\n\n - [Golang][go]\n - [pion/webrtc][pion]\n - github.com/go-chi/chi\n - nhooyr.io/websocket\n\n[pion]: https://github.com/pion/webrtc\n\nSee [go.mod](go.mod) for more information\n\n## Frontend\n\n - React\n - Redux\n - TypeScript (since peer-calls `v2.1.0`)\n\nSee [package.json](package.json) for more information.\n\n# Installation \u0026 Running\n\n## Download Release\n\nHead to [Releases](https://github.com/peer-calls/peer-calls/releases) and\ndownload a precompiled version. Currently the binaries for the following\nsystems are built automatically:\n\n - linux amd64\n - linux arm\n - darwin (macOS) amd64\n - windows amd64\n\n## Deploying onto Kubernetes\n\nThe root of this repository contains a `kustomization.yaml`, allowing anyone to\npatch the manifests found within the `deploy/` directory. To deploy the manifests\nwithout applying any patches, pass the URL to `kubectl`:\n\n```bash\nkubectl apply -k github.com/peer-calls/peer-calls\n```\n\n## Using Docker\n\nThe automated builds on Docker Hub now require a subscription, and approval is\nrequired even for open source projects. We recently switched to using GitHub\nContainer Registry instead:\n\nUse the [`ghcr.io/peer-calls/peer-calls`][ghcr] image:\n\n```bash\ndocker run --rm -it -p 3000:3000 ghcr.io/peer-calls/peer-calls:latest\n```\n\n[ghcr]: https://ghcr.io/peer-calls/peer-calls\n\n## Building from Source\n\n```bash\ngit clone https://github.com/peer-calls/peer-calls.git\ncd peer-calls\nnpm install\n\n# for production\nnpm run build\nnpm run build:go:linux\n\n# for development\nnpm run start\n```\n\n## Building Docker Image\n\n```bash\ngit clone https://github.com/peer-calls/peer-calls\ncd peer-calls\ndocker build -t peer-calls .\ndocker run --rm -it -p 3000:3000 peer-calls\n```\n\n# Configuration\n\n## Environment variables\n\n| Variable                             | Type   | Description                                                                  | Default   |\n|--------------------------------------|--------|------------------------------------------------------------------------------|-----------|\n| `PEERCALLS_LOG`                      | csv    | Enables or disables logging for certain modules                              | `-sdp,-ws,-nack,-rtp,-rtcp,-pion:*:trace,-pion:*:debug,-pion:*:info,*` |\n| `PEERCALLS_FS`                       | string | When set to a non-empty value, use the path to find resource files           |           |\n| `PEERCALLS_BASE_URL`                 | string | Base URL of the application                                                  |           |\n| `PEERCALLS_BIND_HOST`                | string | IP to listen to                                                              | `0.0.0.0` |\n| `PEERCALLS_BIND_PORT`                | int    | Port to listen to                                                            | `3000`    |\n| `PEERCALLS_TLS_CERT`                 | string | Path to TLS PEM certificate. If set will enable TLS                          |           |\n| `PEERCALLS_TLS_KEY`                  | string | Path to TLS PEM cert key. If set will enable TLS                             |           |\n| `PEERCALLS_STORE_TYPE`               | string | Can be `memory` or `redis`                                                   | `memory`  |\n| `PEERCALLS_STORE_REDIS_HOST`         | string | Hostname of Redis server                                                     |           |\n| `PEERCALLS_STORE_REDIS_PORT`         | int    | Port of Redis server                                                         |           |\n| `PEERCALLS_STORE_REDIS_PREFIX`       | string | Prefix for Redis keys. Suggestion: `peercalls`                               |           |\n| `PEERCALLS_NETWORK_TYPE`             | string | Can be `mesh` or `sfu`. Setting to SFU will make the server the main peer    | `mesh`    |\n| `PEERCALLS_NETWORK_SFU_INTERFACES`   | csv    | List of interfaces to use for ICE candidates, uses all available when empty  |           |\n| `PEERCALLS_NETWORK_SFU_JITTER_BUFFER`| bool   | Set to `true` to enable the use of Jitter Buffer                             | `false`   |\n| `PEERCALLS_NETWORK_SFU_PROTOCOLS`    | csv    | Can be `udp4`, `udp6`, `tcp4` or `tcp6`                                      | `udp4,udp6` |\n| `PEERCALLS_NETWORK_SFU_TCP_BIND_ADDR`| string | ICE TCP bind address. By default listens on all interfaces.                  |           |\n| `PEERCALLS_NETWORK_SFU_TCP_LISTEN_PORT`| int  | ICE TCP listen port. By default uses a random port.                          | `0`       |\n| `PEERCALLS_NETWORK_SFU_TRANSPORT_LISTEN_ADDR` | string | When set, will listen for external RTP, Data and Metadata UDP streams |           |\n| `PEERCALLS_NETWORK_SFU_TRANSPORT_NODES`| csv    | When set, will transmit media and data to designated `host:port`(s).  |           |\n| `PEERCALLS_NETWORK_SFU_UDP_PORT_MIN` | int    | Defines ICE UDP range start to use for UDP host candidates.                  | `0`       |\n| `PEERCALLS_NETWORK_SFU_UDP_PORT_MAX` | int    | Defines ICE UDP range end to use for UDP host candidates.                    | `0`       |\n| `PEERCALLS_ICE_SERVER_URLS`          | csv    | List of ICE Server URLs                                                      |           |\n| `PEERCALLS_ICE_SERVER_AUTH_TYPE`     | string | Can be empty or `secret` for coturn `static-auth-secret` config option.      |           |\n| `PEERCALLS_ICE_SERVER_SECRET`        | string | Secret for coturn                                                            |           |\n| `PEERCALLS_ICE_SERVER_USERNAME`      | string | Username for coturn                                                          |           |\n| `PEERCALLS_PROMETHEUS_ACCESS_TOKEN`  | string | Access token for prometheus `/metrics` URL                                   |           |\n| `PEERCALLS_FRONTEND_ENCODED_INSERTABLE_STREAMS` | bool | Enable insertable streams                                           | `false`   |\n\nThe default ICE servers in use are:\n\n- `stun:stun.l.google.com:19302`\n- `stun:global.stun.twilio.com:3478?transport=udp`\n\nOnly a single ICE server can be defined via environment variables. To define\nmore use a YAML config file. To load a config file, use the `-c\n/path/to/config.yml` command line argument.\n\nSee [config/types.go][config] for configuration types.\n\n[config]: ./src/server/config/types.go\n\nExample:\n\n```yaml\nbase_url: ''\nbind_host: '0.0.0.0'\nbind_port: 3005\nice_servers:\n - urls:\n   - 'stun:stun.l.google.com:19302'\n- urls:\n  - 'stun:global.stun.twilio.com:3478?transport=udp'\n#- urls:\n#  - 'turn:coturn.mydomain.com'\n#  auth_type: secret\n#  auth_secret:\n#    username: \"peercalls\"\n#    secret: \"some-static-secret\"\n# tls:\n#   cert: test.pem\n#   key: test.key\nstore:\n  type: memory\n  # type: redis\n  # redis:\n  #   host: localhost\n  #   port: 6379\n  #   prefix: peercalls\nnetwork:\n  type: mesh\n  # type: sfu\n  # sfu:\n  #   interfaces:\n  #   - eth0\nprometheus:\n  access_token: \"mytoken\"\nfrontend:\n  encodedInsertableStreams: false\n```\n\nPrometheus `/metrics` URL will not be accessible without an access token set.\nThe access token can be provided by either:\n\n- Setting `Authorization` header to `Bearer mytoken`, or\n- Providing the access token as a query string: `/metrics?access_token=mytoken`\n\nTo access the server, go to http://localhost:3000.\n\n# Accessing From Network\n\nMost browsers will prevent access to user media devices if the application is\naccessed from the network (not via 127.0.0.1). If you wish to test your mobile\ndevices, you'll have to enable TLS by setting the `PEERCALLS_TLS_CERT` and\n`PEERCALLS_TLS_KEY` environment variables. To generate a self-signed certificate\nyou can use:\n\n```\nopenssl 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\n```\n\nReplace `example.com` with your server's hostname.\n\n# Multiple Instances and Redis\n\nRedis can be used to allow users connected to different instances to connect.\nThe following needs to be added to `config.yaml` to enable Redis:\n\n```yaml\nstore:\n  type: redis\n  redis:\n    host: redis-host  # redis host\n    port: 6379        # redis port\n    prefix: peercalls # all instances must use the same prefix\n```\n\n# Logging\n\nBy default, Peer Calls server will log only basic information. Client-side\nlogging is disabled by default.\n\nServer-side logs can be configured via the `PEERCALLS_LOG` environment variable. Setting\nit to `*` will enable all server-side logging:\n\n- `PEERCALLS_LOG=*`\n\nClient-side logs can be configured via `localStorage.DEBUG` and\n`localStorage.LOG` variables:\n\n- Setting `localStorage.log=1` enables logging of Redux actions and state\n  changes\n- Setting `localStorage.debug=peercalls,peercalls:*` enables all other\n  client-side logging\n\n# Development\n\nBelow are some common scripts used for development:\n\n```\nnpm start              build all resources and start the server.\nnpm run build          build all client-side resources.\nnpm run start:server   start the server\nnpm run js:watch       build and watch resources\nnpm test               run all client-side tests.\ngo test ./...          run all server tests\nnpm run ci             run all linting, tests and build the client-side\n```\n\n# Browser Support\n\nTested on Firefox and Chrome, including mobile versions. Also works on Safari\nand iOS since version 11. Does not work on Microsoft Edge because they do not\nsupport DataChannels yet.\n\nFor more details, see here:\n\n- http://caniuse.com/#feat=rtcpeerconnection\n- http://caniuse.com/#search=getUserMedia\n\nIn Firefox, it might be useful to use `about:webrtc` to debug connection\nissues. In Chrome, use `about:webrtc-internals`.\n\nWhen experiencing connection issues, the first thing to try is to have all\npeers to use the same browser.\n\n# Epheremal UDP Ports for ICE\n\nThe UDP port range can be defined for opening epheremal ports. These ports will\nbe used for generating UDP host ICE candidates. It is recommended to enable\nthese UDP ports when ICE TCP is enabled, because the priority of TCP host\ncandidates will be higher than srflx/prflx candidates, as such TCP will be used\neven though UDP connectivity might be possible.\n\n# ICE TCP\n\nPeer Calls supports ICE over TCP as described in RFC6544. Currently only\npassive ICE candidates are supported. This means that users whose ISPs or\ncorporate firewalls block UDP packets can use TCP to connect to the SFU. In\nmost scenarios, this removes the need to use a TURN server, but this\nfunctionality is currently experimental and is not enabled by default.\n\nAdd the `tcp4` and `tcp6` to your `PEERCALLS_NETWORK_SFU_PROTOCOLS` to enable\nsupport for ICE TCP:\n\n```\nPEERCALLS_NETWORK_TYPE=sfu PEERCALLS_NETWORK_SFU_PROTOCOLS=`udp4,udp6,tcp4,tcp6` peer-calls\n```\n\nTo test this functionality, `udp4` and `udp6` network types should be omitted:\n\n```\nPEERCALLS_NETWORK_TYPE=sfu PEERCALLS_NETWORK_SFU_PROTOCOLS=`tcp4,tcp6` peer-calls\n```\n\nPlease note that in production the `PEERCALLS_NETWORK_SFU_TCP_LISTEN_PORT` should\nbe specified and external TCP access allowed through the server firewall.\n\n# TURN Server\n\nWhen a direct connection cannot be established, it might be help to use a TURN\nserver. The peercalls.com instance is configured to use a TURN server and it\ncan be used for testing. However, the server bandwidth there is not unlimited.\n\nHere are the steps to install a TURN server on Ubuntu/Debian Linux:\n\n```bash\nsudo apt install coturn\n```\n\nUse the following configuration as a template for `/etc/turnserver.conf`:\n\n```bash\nlt-cred-mech\nuse-auth-secret\nstatic-auth-secret=p4ssw0rd\nrealm=example.com\ntotal-quota=300\ncert=/etc/letsencrypt/live/rtc.example.com/fullchain.pem\npkey=/etc/letsencrypt/live/rtc.example.com/privkey.pem\nlog-file=/dev/stdout\nno-multicast-peers\nproc-user=turnserver\nproc-group=turnserver\n```\n\nChange the `p4ssw0rd`, `realm`  and paths to server certificates.\n\nUse the following configuration for Peer Calls:\n\n```yaml\niceServers:\n- urls:\n  - 'turn:rtc.example.com'\n  auth_type: secret\n  auth_secret:\n    username: 'example'\n    secret: 'p4ssw0rd'\n```\n\nFinally, enable and start the `coturn` service:\n\n```bash\nsudo systemctl enable coturn\nsudo systemctl start coturn\n```\n\n# Contributing\n\nSee [Contributing](CONTRIBUTING.md) section.\n\nIf you encounter a bug, please open a new issue!\n\n# Support\n\nThe development of Peer Calls is sponsored by [rondomoon][rondomoon]. If you'd\nlike enterprise on-site support or become a sponsor, please contact\n[hello@rondomoon.com](mailto:hello@rondomoon.com).\n\n[rondomoon]: https://rondomoon.com\n\n# License\n\n[Apache 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeer-calls%2Fpeer-calls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeer-calls%2Fpeer-calls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeer-calls%2Fpeer-calls/lists"}