{"id":21296062,"url":"https://github.com/agustinsrg/webrtc-cdn","last_synced_at":"2025-07-11T17:31:17.110Z","repository":{"id":185868488,"uuid":"470064210","full_name":"AgustinSRG/webrtc-cdn","owner":"AgustinSRG","description":"Live media content delivery network based on the WebRTC protocol.","archived":false,"fork":false,"pushed_at":"2025-04-18T12:36:57.000Z","size":180,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-19T01:48:14.784Z","etag":null,"topics":["audio","cdn","go","golang","video","webrtc","webrtc-signaling","websocket"],"latest_commit_sha":null,"homepage":"","language":"Go","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/AgustinSRG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2022-03-15T08:16:51.000Z","updated_at":"2025-04-18T12:34:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"52188069-7536-4af9-b0ef-59f99b972cc7","html_url":"https://github.com/AgustinSRG/webrtc-cdn","commit_stats":null,"previous_names":["agustinsrg/webrtc-cdn"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/AgustinSRG/webrtc-cdn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgustinSRG%2Fwebrtc-cdn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgustinSRG%2Fwebrtc-cdn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgustinSRG%2Fwebrtc-cdn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgustinSRG%2Fwebrtc-cdn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AgustinSRG","download_url":"https://codeload.github.com/AgustinSRG/webrtc-cdn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgustinSRG%2Fwebrtc-cdn/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264862360,"owners_count":23674951,"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":["audio","cdn","go","golang","video","webrtc","webrtc-signaling","websocket"],"created_at":"2024-11-21T14:18:55.610Z","updated_at":"2025-07-11T17:31:17.098Z","avatar_url":"https://github.com/AgustinSRG.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebRTC CDN\n\nLive media content delivery network based on the WebRTC protocol.\n\n## Compilation\n\nIn order to install dependencies, type:\n\n```\ngo get github.com/AgustinSRG/webrtc-cdn\n```\n\nTo compile the code type:\n\n```\ngo build\n```\n\nThe build command will create a binary in the current directory, called `webrtc-cdn`, or `webrtc-cdn.exe` if you are using Windows.\n\n## Docker Image\n\nYou can find the docker image for this project available in Docker Hub: [https://hub.docker.com/r/asanrom/webrtc-cdn](https://hub.docker.com/r/asanrom/webrtc-cdn)\n\nTo pull it type:\n\n```\ndocker pull asanrom/webrtc-cdn\n```\n\n## Usage\n\nThis project is meant to be used to create a network to deliver live media content using the WebRTC protocol.\n\nIn order to create the network, you can spawn multiple nodes connected to a Redis Pub/Sub service for inter-node communication.\n\nOnce the network is up, clients can connect to the nodes via Websocket (for signaling purposes), in order to request for publishing or receiving media streams via WebRTC.\n\n![Network example](./doc/network.drawio.png \"Network example\")\n\n## Configuration\n\nYou can configure the node using environment variables\n\n### WebRTC options\n\n| Variable Name | Description                                                                             |\n| ------------- | --------------------------------------------------------------------------------------- |\n| STUN_SERVER   | STUN server URL. Example: `stun:stun.l.google.com:19302`                                |\n| TURN_SERVER   | TURN server URL. Set if the server is behind NAT. Example: `turn:turn.example.com:3478` |\n| TURN_USERNAME | Username for the TURN server.                                                           |\n| TURN_PASSWORD | Credential for the TURN server.                                                         |\n\n### Redis\n\nTo configure the redis connection, set the following variables:\n\n| Variable Name  | Description                                                                                                      |\n| -------------- | ---------------------------------------------------------------------------------------------------------------- |\n| STAND_ALONE    | Set it to `YES` if you want to disable redis and just use a single node. By default, `webrtc-cdn` will use redis |\n| REDIS_PORT     | Port to connect to Redis Pub/Sub. Default is `6379`                                                              |\n| REDIS_HOST     | Host to connect to Redis Pub/Sub. Default is `127.0.0.1`                                                         |\n| REDIS_PASSWORD | Redis authentication password, if required.                                                                      |\n| REDIS_TLS      | Set it to `YES` in order to use TLS for the connection.                                                          |\n\n### TLS for signaling\n\nIf you want to use TLS for the websocket connections (recommended), you have to set the following variables in order for it to work:\n\n| Variable Name            | Description                                                                         |\n| ------------------------ | ----------------------------------------------------------------------------------- |\n| SSL_PORT                 | HTTPS listening port. Default is `443`                                              |\n| SSL_CERT                 | Path to SSL certificate (REQUIRED).                                                 |\n| SSL_KEY                  | Path to SSL private key (REQUIRED).                                                 |\n| SSL_CHECK_RELOAD_SECONDS | Number of seconds to check for changes in the certificate or key (for auto renewal) |\n\n### Authentication\n\nAuthentication options:\n\n| Variable Name | Description                                                                                                                      |\n| ------------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| JWT_SECRET    | Secret to validate JSON web tokens used for authentication in the signaling protocol. If not set, no authentication is required. |\n\n### More options\n\nHere is a list with more options you can configure:\n\n| Variable Name                 | Description                                                                                                                        |\n| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |\n| HTTP_PORT                     | HTTP listening port for insecure websocket connections, used for signaling. Default is `80`                                        |\n| BIND_ADDRESS                  | Bind address for signaling services. By default it binds to all network interfaces.                                                |\n| LOG_REQUESTS                  | Set to `YES` or `NO`. By default is `YES`                                                                                          |\n| LOG_DEBUG                     | Set to `YES` or `NO`. By default is `NO`                                                                                           |\n| MAX_IP_CONCURRENT_CONNECTIONS | Max number of concurrent connections to accept from a single IP. By default is 4.                                                  |\n| CONCURRENT_LIMIT_WHITELIST    | List of IP ranges not affected by the max number of concurrent connections limit. Split by commas. Example: `127.0.0.1,10.0.0.0/8` |\n| MAX_REQUESTS_PER_SOCKET       | Max number of active requests for a single websocket session. By default is `100`                                                  |\n\n## Firewall configuration\n\nThe ports used by the signaling websocket server must be opened, they are `80` and `443` by default.\n\nIn order for the nodes to be able to communicate via WebRTC, they need to use the port range `40000:65535/UDP`\n\nIf you use a TURN server there is no need for the UDP ports to be opened, since communication can be accomplish using the TURN server as intermediate.\n\n## Documentation\n\nCheck the documentation in order to connect to the nodes:\n\n- [Signaling protocol](./doc/signaling.md)\n\nIf you want to know about the inter-node communication protocol check:\n\n- [Inter-Node communication protocol](./doc/redis.md)\n\n## Client Libraries\n\nHere is a list of available client libraries to connect to webrtc-cdn:\n\n- [Javascript client for NodeJS and web browsers](https://github.com/AgustinSRG/webrtc-cdn-client)\n\n## Utilities / Experiments\n\nHere is a list of utilities and experiments based of webrtc-cdn:\n\n- [Video Publisher](https://github.com/AgustinSRG/webrtc-publish)\n- [Forwarder](https://github.com/AgustinSRG/webrtc-forwarder)\n- [Video filtering](https://github.com/AgustinSRG/webrtc-video-filter)\n\n## License\n\nThis project is under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagustinsrg%2Fwebrtc-cdn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagustinsrg%2Fwebrtc-cdn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagustinsrg%2Fwebrtc-cdn/lists"}