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
HTTPをしゃべろう~Firefoxになるために~
Search
tera
October 01, 2016
Technology
0
240
HTTPをしゃべろう~Firefoxになるために~
平成28年10月1日(土): CookHack #1 〜火狐(フォクすけ)とパイを焼きまくれ!〜 にて話しました
tera
October 01, 2016
Tweet
Share
More Decks by tera
See All by tera
ピッてやるとシュッてなるやつを作った話
tera
0
260
Pythonを読む
tera
0
220
importを理解したかった
tera
0
660
RustでShell作ろう
tera
0
930
Other Decks in Technology
See All in Technology
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.6k
BidiAgent と Nova 2 Sonic から考える音声 AI について
yama3133
2
150
AI に「学ばせ、調べさせ、作らせる」。Auth0 開発を加速させる7つの実践的アプローチ
scova0731
0
200
スクラムを一度諦めたチームにアジャイルコーチが入ってどう変化したか / A Team's Second Try at Scrum with an Agile Coach
kaonavi
0
200
『君の名は』と聞く君の名は。 / Your name, you who asks for mine.
nttcom
1
160
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
330
202512_AIoT.pdf
iotcomjpadmin
0
190
迷わない!AI×MCP連携のリファレンスアーキテクチャ完全ガイド
cdataj
0
420
あの夜、私たちは「人間」に戻った。 ── 災害ユートピア、贈与、そしてアジャイルの再構築 / 20260108 Hiromitsu Akiba
shift_evolve
PRO
0
550
I tried making a solo advent calendar!
zzzzico
0
150
ハッカソンから社内プロダクトへ AIエージェント ko☆shi 開発で学んだ4つの重要要素
leveragestech
0
640
純粋なイミュータブルモデルを設計してからイベントソーシングと組み合わせるDeciderの実践方法の紹介 /Introducing Decider Pattern with Event Sourcing
tomohisa
1
920
Featured
See All Featured
Facilitating Awesome Meetings
lara
57
6.7k
Marketing to machines
jonoalderson
1
4.5k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
96
The #1 spot is gone: here's how to win anyway
tamaranovitovic
1
890
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
220
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
94
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
230
[SF Ruby Conf 2025] Rails X
palkan
0
700
Transcript
HTTPをしゃべろう ~Firefoxになるために~ By @tera_3939
自己紹介 • お名前 • @tera_3939 • 所属 • Firefox学生マーケティングチーム •
Rustはむつかしい…… • Webできない……
はなすこと • 自己紹介 • Firefoxが何をしているか知る • HTTPについて • リクエスト •
レスポンス • 実際にしゃべる
Firefoxになるためには
まず何をしているか知ろう
Firefoxが何をしているのか HTTP・HTTPS とかで リソースを取ってくる レンダリングエンジンで ちょめちょめ Webページを表示 詳しくは:“ブラウザの仕組み: 最新ウェブブラウザの内部構造” http://www.html5rocks.com/ja/tutorials/internals/howbrowserswork/
Firefoxが何をしているのか HTTP・HTTPS とかで リソースを取ってくる レンダリングエンジンで ちょめちょめ Webページを表示 今回は ここになる 詳しくは:“ブラウザの仕組み:
最新ウェブブラウザの内部構造” http://www.html5rocks.com/ja/tutorials/internals/howbrowserswork/
くわしいひとへ • 今回HTTPSのお話はないです • HTTP/2のお話もないです • (というか僕がまったくわからない)
HTTPとは • HyperTextTransferProtocol • ステートレス • C/Sモデル • リクエストとレスポンスで成り立っている •
テキストデータでやり取り • TCPで80番ポート • 今はもう大概HTTPS
しくみ クライアント サーバー リソースちょーだい あいよ リクエスト レスポンス
実際に見てみる • Firefoxの開発ツール(F12)のネットワークで確認
リクエスト • クライアントからサーバーに要求をする • /index.htmlをちょーだい、とか
要求例 GET /hoge/fuga.html HTTP/1.1 // request-line Host: foobar.co.jp // header-field
request-line • どんなリクエストなのか表す • データを取得するだけとか、データを送信したいとか
request-line method SP request-target SP HTTP-version CRLF SP: 半角スペース CRLF:
改行文字
request-line • method • サーバーに要求する動作の指定 ex) GET, POST • request-target
• 要求するコンテンツの場所 ex) /, /img/hoge.png • HTTP-version • 使用するプロトコルのバージョン ex) 1.1
header-field • リクエスト自身の情報を表す • HostとかUser-Agentとか
header-field field-name “:” OWS field-value OWS OWS: 省略可能な半角スペース
header-field • field-name • HostとかUser-Agentとか • field-value • ドメイン名とか
レスポンス • サーバーからの応答 • 問題ないよとか、そんなもんねぇよとか
応答例 HTTP/1.1 200 OK // status-line Date: Tue, 20 Sep
2016 14:25:52 GMT // header-field Content-Type: text/html ...
status-line HTTP-version SP status-code SP reason-phrase CRLF SP: 半角スペース CRLF:
改行
status-line • HTTP-version • HTTPのバージョン ex) HTTP/1.1とか • status-code •
サーバーの応答結果 ex) 200とか404とか • reason-phrase • status-codeに対応した単語とか ex)OKとかNOT FOUNDとか
header-field • field-name • Content-TypeとかDateとか • field-value • text/htmlとか
まとめると
リクエストを送ると GET /hoge/fuga.html HTTP/1.1 // request-line Host: foobar.co.jp // header-field
応答が来る HTTP/1.1 200 OK // status-line Date: Tue, 20 Sep
2016 14:25:52 GMT // header-field Content-Type: text/html ...
これをさえあれば • HTTPがしゃべれる!!
これをさえあれば • HTTPがしゃべれる!! =Firefoxになれる!!!
実際に“なってみる“
telnet • TCPを話せる • 相手につないでテキストデータを送れる • デフォルトのポート番号は23番
$ telnet domain.name 80
None
Firefoxになった!!(?)
5分9厘ぐらいは……
まとめ • Firefoxは偉大
詳細 • RFC(Request for Comments) • HTTP/1.1は7230~7235に書いてある(らしい) • 結構みっちり決まってる •
英語(死)