Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
WebTransport mini handson
Search
D.F.Mac. @TripArts Music
June 27, 2024
Technology
0
34
WebTransport mini handson
2024.06.28 に某所で実施予定の「WebTransport ミニミニハンズオン」の資料です。
D.F.Mac. @TripArts Music
June 27, 2024
Tweet
Share
More Decks by D.F.Mac. @TripArts Music
See All by D.F.Mac. @TripArts Music
ちーん2024
tadfmac
0
420
Other Decks in Technology
See All in Technology
How to be an AWS Community Builder | 君もAWS Community Builderになろう!〜2024 冬 CB募集直前対策編?!〜
coosuke
PRO
2
2.8k
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
250
C++26 エラー性動作
faithandbrave
2
660
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
160
社外コミュニティで学び社内に活かす共に学ぶプロジェクトの実践/backlogworld2024
nishiuma
0
250
CustomCopを使ってMongoidのコーディングルールを整えてみた
jinoketani
0
220
[Ruby] Develop a Morse Code Learning Gem & Beep from Strings
oguressive
1
150
開発生産性向上! 育成を「改善」と捉えるエンジニア育成戦略
shoota
1
230
コンテナセキュリティのためのLandlock入門
nullpo_head
2
320
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
180
Wantedly での Datadog 活用事例
bgpat
1
400
新機能VPCリソースエンドポイント機能検証から得られた考察
duelist2020jp
0
210
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
94
A better future with KSS
kneath
238
17k
Building an army of robots
kneath
302
44k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Being A Developer After 40
akosma
87
590k
Designing Experiences People Love
moore
138
23k
Facilitating Awesome Meetings
lara
50
6.1k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
BBQ
matthewcrist
85
9.4k
Transcript
WebTransport ϛχϛχϋϯζΦϯ ͩ͜·ɹͻͰΏ͖ Teams!"#ˠ IUUQTHJTUHJUIVCDPNUBEGNBDFEFEDCFEB ࣄલ४උ
ࣗݾհ ͩ͜·ɹͻͰΏ͖ 8FCΤϯδχΞϓϩτλΠϐϯά͖ !UBEGNBD IUUQTHJUIVCDPNUBEGNBD
ΞδΣϯμ 8FC5SBOTQPSUͱ ϛχϛχϋϯζΦϯ ʢϩʔΧϧ1$Ͱ8FC5SBOTQPSUαʔόʔΛཱͯͯϒϥβ͔Β৮ͬͯΈΔʣ
8FC5SBOTQPSUͱ ৽͍͠Ϩϕϧτϥϯεϙʔτ"1*ɻʢͳΜͰ͜Μͳࡶͳઆ໌ͳͷ͔ ޙड़ʣ Լهͭͷ"1*Λఏڙɻ 4USFBN"1* ˠॱংอূɺύέϩε࣌ͷ࠶ૹ੍ޚ͋Γɻ৴པੑ͕ߴ͍ɻ EBUBHSBN"1* ˠॱংอূͳ͠ɺύέϩε࣌ͷ࠶ૹ੍ޚͳ͠ɻ৴པੑ͕͍ɻ IUUQTXXXXPSH53XFCUSBOTQPSU ༷·ͩ8%ɻ࠷৽൛ͷΞοϓσʔτ
8FC5SBOTQPSUͱ
͑Δڥ 4BGBSJͪɻ 8FC5SBOTQPSUͱ ͨͩ͠ɺ͜Εɺ Ҿ༻ݩɿIUUQTDBOJVTFDPN TFBSDIXFCUSBOTQPSU ͭ·Γɺʮ4FSWFS$MJFOUؒͷʯʮ)551ϕʔεͷʯ༷ͷɻ
4FSWFS$MJFOUؒͷ)551ϕʔεͷ8FC5SBOTQPSUʁ ͜Ε 8FC5SBOTQPSUͱ Ҿ༻ݩɿIUUQTEBUBUSBDLFSJFUGPSHEPDIUNMESBGUJFUGXFCUSBOTIUUQ
8FC5SBOTQPSUPWFS)551ͱ 8FC5SBOTQPSUͱ )551ϕʔεͷαʔόʔΫϥΠΞϯτؒͰͷํτϥϯεϙʔτ"1* )551ʢ26*$ʣϕʔεͳͷͰɺ6%1Ͱ&&҉߸ԽͰ௨৴͢Δɻ Լهͭͷ"1*Λఏڙɻ 4USFBN"1* ˠॱংอূɺύέϩε࣌ͷ࠶ૹ੍ޚ͋Γɻ৴པੑ͕ߴ͍ɻ EBUBHSBN"1* ˠॱংอূͳ͠ɺύέϩε࣌ͷ࠶ૹ੍ޚͳ͠ɻ৴པੑ͕͍ɻ
8FCݕࡧͯ͠ݟ͔ͭΔ8FC5SBOTQPSUͷઆ໌ɺ͍͍ͩͨ͜Εɻ ͱͱͷ8FC5SBOTQPSUͷϞνϕͷ༷͜ΕͳͷͰɺਖ਼ղͱ͍͑ਖ਼ղɻ
Ͳ͏ͳͬͪΌͬͨͷ 8FC5SBOTQPSUͱ Ҿ༻ݩɿIUUQTXXXXPSHTUBOEBSETIJTUPSZXFCUSBOTQPSU 8FC5SBOTQPSUPWFS)551Ճ 8FC5SBOTQPSUPWFS)551Ͱ࢝·Δ
͜͏ͳͬͨɻʢͷ༷ͰมΘΒͣʣ 8FC5SBOTQPSUͱ Ҿ༻ݩɿIUUQTXXXXPSH53XFCUSBOTQPSUJOUSPEVDUJPO ˠ)551ϕʔεʢ5$1ϕʔεʣͰ8FC5SBOTQPSUϓϩτίϧ͕͑ΔΑ͏ʹɺ ɹ8FC5SBOTQPSUPWFS)551ͷ༷͕Ճ͞Εͨɻ Ҿ༻ݩɿIUUQTEBUBUSBDLFSJFUGPSHEPDIUNMESBGUJFUGXFCUSBOTIUUQ
ͳΜͰ5$1ϕʔε͕Ճ͞Εͨͷ 8FC5SBOTQPSUͱ ˠ6%126*$͑ͳ͍γʔϯଟ͍͔Βɻ ྫɿ ɹɾ6%1ϙʔτۭ͍ͯͳ͍ ɹɾ1SPYZαʔόʔ͘Μ͕अຐ͢Δ ϦΞϧλΠϜੑೳ
ˠવԼ͕Δͱ༧ɻʢ࣮͕ແ͍ͷͰɺͲͷ͘Β͍Լ͕Δ͔Θ͔ΒΜ͚Ͳʣ PWFS)551ʹμϯάϨʔυͯ͠خ͍͠Ϣʔεέʔε ˠ8FC4PDLFUͷΘΓʹϕετΤϑΥʔτͰੑೳ্͛ͯ8FC5SBOTQPSUΛ͍͍ͨ ɹˠૣ͞ΑΓܨ͍͛ͨɺͱ͍͏ํ ɹɹˠͰɺ8FC4PDLFUͷ··Ͱ͍͍ͷͰʁͱ͍͏ٙɻ PWFS)551ʹμϯάϨʔυ͞ΕͯࠔΓͦ͏ͳϢʔεέʔε ˠEBUBHSBN͍͍͔ͨΒ8FC5SBOTQPSUΛ͏Α͏ͳγʔϯɻ ɹྫ͑ɺ.FEJBPWFS2VJDͷϕʔεͱͯ͠8FC5SBOTQPSUͬͯΔͱ͔ͷ࣌ɺ ɹεϧʔϓοτͰͳ͍Μ͡Όͳ͍͔ʁͱࢥ͏ɻ
Ͱɺશʹ༨ஊɻ 8FC5SBOTQPSUͱ Ҿ༻ݩɿIUUQTXDHJUIVCJPQQXFCUSBOTQPSU 117FSTJPO
8FC5SBOTQPSUͱ ·ͱΊɻ 8FC5SBOTQPSUͱ 8$8% ˠ·༷ͩࡦఆத͕ͩɺ৽͍͠Ϩϕϧτϥϯεϙʔτ"1*ɻΒ͍͠ɻ ˠ݄ݱࡏී௨ʹར༻Ͱ͖Δͷ8FC5SBOTQPSUPWFS)551ͷΈɻ ɹ!GBJMTDPNQPSOFOUXFCUSBOTQPSU͕PWFS)551༻ͷQPMZ fi MM
TFSWFS࣮Λެ։͍ͯ͠Δɻ͍͢͝ɻ 6%1 5$1 )551 )551 8FC5SBOTQPSU PWFS)551 8FC5SBOTQPSU PWFS)551 8FC5SBOTQPSU GPS11 4BGBSJҎ֎ͷϒϥβରԠ ·ͩͲͷϒϥβະରԠ ·ͩͲͷϒϥβະରԠ 5-4 26*$ 5-4
8FC5SBOTQPSUͱ ·ͱΊɻ 8FC5SBOTQPSUͱ ࡶ͗ͯ͢ɺϚαΧϦͱΜͰ͖ͦ͏͚ͩͲɺ͍͍ͩͨ͜Μͳײͩ͡ͱࢥ͏ɻ )551GFUDI 9)3 8FC4PDLFU 8FC35$ 8FC5SBOTQPSU
PWFS)551 ৴པੑ ˓ ˓ ºNFEJBTUSFBN ˚ʙ˓EBUBDI ˚4USFBN º%BUBHSBN ϦΞϧλΠϜੑೳ º º ˓ ˚4USFBN ˓%BUBHSBN ηΩϡϦςΟ ˓44-ͷ߹ ºඇ44-ͷ߹ ˓44-ͷ߹ ºඇ44-ͷ߹ ˓ ˓ ࠓ͑Δ͔ʁ ˓ ˓ ˓ º4BGBSJͪ ௨৴ํ $ˠ4ͷΈ $⁶4ํ جຊతʹ$ˠ$ ͷٕज़ $⁶4ํ ͍ॴ σʔλ"1*ɺ ίϯςϯπऔಘ νϟοτ ํ"1* αʔόʔΠϕϯτ ϝσΟΞ௨৴ 11ڞ༗ ήʔϜ ϦΞϧλΠϜಉظ .P2
WebTransport ϛχϛχϋϯζΦϯ ͩ͜·ɹͻͰΏ͖ Teams!"#ˠ IUUQTHJTUHJUIVCDPNUBEGNBDFEFEDCFEB ࣄલ४උ
Δ͜ͱ֓ཁ 8FC5SBOTQPSUϨϕϧͳ"1*ઃܭͳͷͰɺΞϓϦέʔγϣϯ͔Βѻ͏ͷগʑࠎ͕ંΕ·͢ɻ ɾී௨ʹίʔσΟϯά͕ΊΜͲ͍͘͞ʢԼهࢀরʣ ɾূ໌ॻ͕͍Ζ͍ΖΊΜͲ͍͘͞ʢ)551ͷੑʣ ɾͦͦOPEFKT·ͩ)551ʹରԠͯ͠ͳ͍͔Β͍Ζ͍Ζ͕ඞཁ͚ͩͲɺԿΛ͢Ε͍͍͔ʁ ɹௐΔ͚ͩͰେมʢݹ͍ใʹΘ͞ΕΔʣ ͜ΕΛղܾ͢ΔͨΊʹɺ4FSWFS$MJFOUͷςετڥΛ؆୯ʹ্ཱͪ͛ΒΕΔϥούʔϥΠϒϥϦΛ
ͬͨαϯϓϧΛͭ͘Γ·ͨ͠ɻ ͷͰɺ͜ΕΛͬͯരXFCUSBOTQPSUڥͷߏஙΛࢼ͢ɻͱ͍͏ϋϯζΦϯͰ͢ɻ 8FC4PDLFUड৴ॲཧͷྫ const ws = new WebSocket(url); ws.onmessage = (e)=>{ // onmessageॲཧ; } 8FC5SBOTQPSUड৴ॲཧͷྫʢTUSFBNʣ const wt = new WebTransport(url); const st = wt.incomingUnidirectionalStreams; const reader = st.getReader(); while (true) { const { done, value } = await reader.read(); if (done) { break; } await readData(value); } async function readData(receiveStream) { const reader = receiveStream.getReader(); while (true) { const { done, value } = await reader.read(); if (done) { break; } // ड৴ॲཧ } }
Լه63-ΞΫηεʂ Teams!"#ˠ IUUQTHJUIVCDPNUBEGNBDQPXUFYBNQMF μϯϩʔυऴΘͬͨΒɺຊޠϖʔδʂ ࠷ॳʹ[JQΛμϯϩʔυ͍ͯͩ͘͠͞ɻ[JQղౚޙɺϑΥϧμ໊ΛʮQPXUFYBNQMFʯʹมߋ
NLDFSUΠϯετʔϧ NBDʮλʔϛφϧʯىಈ brew install mkcert XJOཧऀϞʔυͰQPXFSTIFMMىಈ choco install mkcert cd
powt-example1/cert mkcert --install mkcert localhost MPDBMIPTUূ໌ॻΠϯετʔϧ cd .. npm i node ./app.mjs OQNJ ΞϓϦىಈ chrome://flags#webtransport-developer-mode ϒϥβ fl BHมߋ DISPNFΛىಈ͠ɺΞυϨεόʔʹԼهೖྗ <FOBCMFE>ʹมߋ͠ϒϥβ࠶ىಈ ΫϥΠΞϯτΞΫηε https://localhost:4445 DISPNFΛىಈ͠ɺΞυϨεόʔʹԼهೖྗ
Thanks! Teams!"#ˠ