Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Local Peer-to-Peer APIはどのように使われていくのか?

Avatar for Hal Hal
September 21, 2025

Local Peer-to-Peer APIはどのように使われていくのか?

2025/9/21(日)に開催されたフロントエンドカンファレンス東京にて、現在策定中のWeb API "Local Peer-to-Peer API"についてお話しました。

Avatar for Hal

Hal

September 21, 2025
Tweet

More Decks by Hal

Other Decks in Programming

Transcript

  1. Copyright © LIXIL Corporation. All rights reserved. Local Peer-to-Peer APIは

    どのように使われていくのか? アプリケーションエキスパート Hal
  2. Hal 株式会社LIXIL Japan SoE DevOps. Digital E-Application Exp. 自己紹介 2025.3

    LIXIL入社 フロントエンドメインの シャトルランエンジニア🚀 基幹システム刷新や 社内向けMCPサーバー開発やっています 最近の技術スタック • Nuxt / Vue.js • Go • Google Cloud 趣味 • Vue.js • ロードバイク • 映画
  3. 扱う内容 • Local Peer-to-Peer APIの概要 • 期待されるユースケース • 類似技術との違い •

    現在の状況 扱わない内容 • P2Pの基礎的な知識 • Web RTC(一部言及あり) • 具体的な実装(策定中のため変わる可能性大) 本スライドで扱う内容
  4. Local Peer-to-Peer APIの概要 P2Pをざっくりいうと・・・ →サーバーを経由せず端末同士で直接通信を行える技術 →P2Pが発展するとeCDNのようなUXの良い仕組みが実現しやすくなる Local Peer-to-Peer API(以降LP2P)は 「サーバーを介さずに現代のセキュリティ要件を満たしつつ、

    Webにおけるローカル通信を安全に実現すること」 を目標としている 提案と仕様策定はIntel社のメンバーが中心に行っている Open Screen Network Protocol上にAPIを実装する方法について規定 WebRTCやWeb Share APIなど、代替手段との比較も行われている(後ほど言及)
  5. 大まかな仕様と用途 1. ピア間の相互TLS証明書を確立 2. 証明書をトラストアンカーとして利用し、ピア同士のローカル通信を行う 引用: 1. Enabling HTTPS on

    the local communication medium. 2. Enabling secure local communication using the DataChannel and WebTransport APIs. • ローカルデバイス間通信でHTTPSを使えるように(Local HTTPS) • WebTransportやDataChannel等を用いた安全な相互通信 https://github.com/WICG/local-peer-to-peer/blob/main/EXPLAINER.md#solution-approach
  6. 期待されるユースケース 2. 人道支援活動 a. インターネットが使えない現場でも情報共有やコミュニケーションを可能 に b. 予め大きなファイルを1ユーザが取得し、現地で各ユーザが取得 e.g. ローカルHTTPSで機能するPWAアプリを現地配信可能に

    https://github.com/WICG/local-peer-to-peer/blob/main/EXPLAINER.md#use-cases 1. The ability for Web-based tools to work on ad-hoc networks in the absence of internet infrastructure. 2. An app that allows humanitarian field workers in remote areas with no connectivity to gather, synchronize, review, and edit data offline for several days, the data can then be synchronized with the central server when internet connection becomes available 3. A non-profit educational organization is concerned about the large file download size required for on-device speech recognition in the browser. This is problematic in low bandwidth, high latency environments such as classrooms, particularly in emerging countries. Their goal is for one student to download the file first and then easily share/distribute it with classmates without low speed internet connections any more to save time and cost
  7. 期待されるユースケース 2. 人道支援活動 a. インターネットが使えない現場でも情報共有やコミュニケーションを可能 に b. 予め大きなファイルを1ユーザが取得し、現地で各ユーザが取得 e.g. ローカルHTTPSで機能するPWAアプリを現地配信可能に

    https://github.com/WICG/local-peer-to-peer/blob/main/EXPLAINER.md#use-cases 1. The ability for Web-based tools to work on ad-hoc networks in the absence of internet infrastructure. 2. An app that allows humanitarian field workers in remote areas with no connectivity to gather, synchronize, review, and edit data offline for several days, the data can then be synchronized with the central server when internet connection becomes available 3. A non-profit educational organization is concerned about the large file download size required for on-device speech recognition in the browser. This is problematic in low bandwidth, high latency environments such as classrooms, particularly in emerging countries. Their goal is for one student to download the file first and then easily share/distribute it with classmates without low speed internet connections any more to save time and cost PWAが激アツになる?
  8. 実装された際の利用イメージはGitHubリポジトリに書かれています。 仕様策定中なので変更する可能性があります。 実装時のイメージ(Shorthand API) // Peer A const listener =

    lp2p.makeDiscoverable(options); for await (const transport of listener.incomingTransports) { await transport.ready; } // Peer B const transport = lp2p.connect(options); await transport.ready; https://github.com/WICG/local-peer-to-peer/issues/35
  9. 作業草案 (Working Draft) Web標準化までのプロセス 新たに提案したAPIや仕様をWeb標準として確立させるには W3C勧告プロセスという以下手順を完了させる必要があります。 https://www.kanzaki.com/w3c/process.html https://www.w3.org/2004/02/Process-20040205/tr.html 勧告候補 (Candidate

    Recommendation) 勧告案 (Proposed Recommendation) W3C勧告 (Recommendation) 個人、グループで仕様を決める 3ヶ月以内に更新が必要 諮問委員会が実装の試行を行う この期間に実装できなかった 箇所はfeatures at riskに指定 問題がある箇所はリジェクト ディレクタが諮問委員会に レビューを依頼する レビュー期間は最低4週間 評価結果によっては WD,CRに戻される 十分な支持が得られたものと 判断され、 Web標準として一般公開される