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
30
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
390
Other Decks in Technology
See All in Technology
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
0
110
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
5
560
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
360
【Pycon mini 東海 2024】Google Colaboratoryで試すVLM
kazuhitotakahashi
2
490
Application Development WG Intro at AppDeveloperCon
salaboy
0
180
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
350
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
190
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
0
980
CysharpのOSS群から見るModern C#の現在地
neuecc
1
3.1k
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
860
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
GraphQLとの向き合い方2022年版
quramy
43
13k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Done Done
chrislema
181
16k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
4 Signs Your Business is Dying
shpigford
180
21k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
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!"#ˠ