{"id":181,"date":"2026-02-20T20:10:15","date_gmt":"2026-02-20T20:10:15","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/a_mermur\/?p=181"},"modified":"2026-02-20T20:18:52","modified_gmt":"2026-02-20T20:18:52","slug":"free-friday-2","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/a_mermur\/2026\/02\/20\/free-friday-2\/","title":{"rendered":"Free Friday"},"content":{"rendered":"\n<p>Today I fixed my site. I have a site to talk my friends using <strong>WebRTC<\/strong>. I had a bug that when more than two people the public key will not share and they can not hear each other. So I made it push out the key to all people in the call<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  \/\/ Receive and store client's public key (JWK) and relay to room\n  socket.on(\"public-key\", ({ roomId, publicKeyJwk }) => {\n    if (!roomId || !publicKeyJwk) return;\n    rooms&#91;roomId] = rooms&#91;roomId] || {};\n    rooms&#91;roomId]&#91;socket.id] = rooms&#91;roomId]&#91;socket.id] || {};\n    rooms&#91;roomId]&#91;socket.id].publicKeyJwk = publicKeyJwk;\n\n    \/\/ relay this public key to others in room (so they can derive pairwise keys)\n    socket.to(roomId).emit(\"user-public-key\", {\n      socketId: socket.id,\n      publicKeyJwk,\n    });\n  });\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Today I fixed my site. I have a site to talk my friends using WebRTC. I had a bug that when more than two people the public key will not share and they can not hear each other. So I made it push out the key to all people in the call<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-181","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/posts\/181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/comments?post=181"}],"version-history":[{"count":3,"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":184,"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/posts\/181\/revisions\/184"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/media?parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/categories?post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/tags?post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}