{"id":16534415,"url":"https://github.com/cristipufu/peerjs-server-net","last_synced_at":"2025-03-23T13:32:31.686Z","repository":{"id":90250246,"uuid":"253184637","full_name":"cristipufu/peerjs-server-net","owner":"cristipufu","description":"ASP.NET Core Server for the PeerJS library which simplifies peer-to-peer data, video, and audio calls.","archived":false,"fork":false,"pushed_at":"2022-03-12T11:08:38.000Z","size":674,"stargazers_count":34,"open_issues_count":1,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-18T20:54:05.149Z","etag":null,"topics":["aspnet-core","peerjs","peerjs-server","webrtc","webrtc-demos","webrtc-experiments","webrtc-signaling","websocket-server","websockets"],"latest_commit_sha":null,"homepage":"","language":"C#","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/cristipufu.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}},"created_at":"2020-04-05T08:04:25.000Z","updated_at":"2025-02-11T16:07:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"459ea8fe-82a1-417d-a933-af2c88f2b833","html_url":"https://github.com/cristipufu/peerjs-server-net","commit_stats":null,"previous_names":["cristipufu/peerjs-server-net","cristipufu/peerjs-server.net"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristipufu%2Fpeerjs-server-net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristipufu%2Fpeerjs-server-net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristipufu%2Fpeerjs-server-net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristipufu%2Fpeerjs-server-net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cristipufu","download_url":"https://codeload.github.com/cristipufu/peerjs-server-net/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245108297,"owners_count":20562021,"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":["aspnet-core","peerjs","peerjs-server","webrtc","webrtc-demos","webrtc-experiments","webrtc-signaling","websocket-server","websockets"],"created_at":"2024-10-11T18:24:06.399Z","updated_at":"2025-03-23T13:32:30.834Z","avatar_url":"https://github.com/cristipufu.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# peerjs-server.net\n\nASP.NET Core Server for the [PeerJS library](https://peerjs.com/) which simplifies peer-to-peer data, video, and audio calls.\n\nTo broker connections, PeerJS connects to a PeerServer. Note that no peer-to-peer data goes through the server; The server acts only as a connection broker.\n\nThis is an ASP.NET Core port of the [Node.js implementation](https://github.com/peers/peerjs-server).\n\n## Server setup\n\n```C#\npublic void ConfigureServices(IServiceCollection services)\n{\n    ...\n    // register PeerJs Server dependencies\n    services.AddPeerJsServer();\n}\n\npublic void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n{\n    ...\n    // enable PeerJs Server middleware\n    app.UsePeerJsServer();        \n}\n```\n\nThat's it, we're good to go.\n\n## Client library setup\n\nThe repository also contains a demo project.\n\nHowever, we can read more about the library usage on the [official website](https://peerjs.com/docs.html). Here's a quick sample:\n\nAdd the PeerJS client library to your webpage:\n```html\n\u003cscript src=\"https://unpkg.com/peerjs@1.0.0/dist/peerjs.min.js\"\u003e\u003c/script\u003e\n```\n\nCreate the Peer object:\n```js\nconst peer = new Peer(randomId, {\n    host: 'localhost',\n    port: 44329,\n    path: '/'\n});\n```\n\nStart a call:\n```js\n// Call a peer, providing our mediaStream\nnavigator.mediaDevices\n    .getUserMedia({\n        audio: true,\n        video: true\n    })\n    .then(function (mediaStream) {\n        myVideo.srcObject = mediaStream;\n        // Call a peer, providing our mediaStream\n        var call = peer.call('dest-peer-id', mediaStream);\n    });\n```\n\nAnswer call:\n```js\npeer.on('call', function(call) {\n  // Answer the call, providing our mediaStream\n  call.answer(mediaStream);\n});\n```\n\nUse the stream:\n```js\ncall.on('stream', function(stream) {\n  // `stream` is the MediaStream of the remote peer.\n  // Here you'd add it to an HTML video/canvas element.\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristipufu%2Fpeerjs-server-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcristipufu%2Fpeerjs-server-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristipufu%2Fpeerjs-server-net/lists"}