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
PROXY Protocol aware Proxy Server on Node.js
Search
moznion
April 27, 2019
Technology
2
2.6k
PROXY Protocol aware Proxy Server on Node.js
This slides for Kyoto.js #16
moznion
April 27, 2019
Tweet
Share
More Decks by moznion
See All by moznion
履歴テーブル、今回はこう作りました 〜 Delegated Types編 〜 / How We Built Our History Table This Time — With Delegated Types
moznion
16
11k
「データ無い! 腹立つ! 推論する!」から 「データ無い! 腹立つ! データを作る」へ チームでデータを作り、育てられるようにするまで / How can we create, use, and maintain data ourselves?
moznion
10
7k
避けられないI/O待ちに対処する: Rails アプリにおけるSSEとasync gemの活用 / Tackling Inevitable I/O Latency in Rails Apps with SSE and the async gem
moznion
3
5.2k
RubyKaigi Hack Space in Tokyo & 函館最速 "予習" 会 / RubyKaigi Hack Space in Tokyo & The Fastest Briefing of RubyKaigi 2026 in Hakodate
moznion
1
300
地に足の付いた現実的な技術選定から魔力のある体験を得る『AIレシート読み取り機能』のケーススタディ / From Grounded Tech Choices to Magical UX: A Case Study of AI Receipt Scanning
moznion
6
4.7k
Chrome Extension Techniques from Hell
moznion
1
270
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
4
8.5k
AIレシート読み取り機能をRuby on Rails on AWSで実現するLLMにまつわるアレコレ / AI-based receipt reading function powered by LLM on Ruby on Rails on AWS
moznion
3
1.1k
Develop to Survive - YAPC::Hakodate 2024 Keynote
moznion
11
21k
Other Decks in Technology
See All in Technology
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
220
システムのアラート調査をサポートするAI Agentの紹介/Introduction to an AI Agent for System Alert Investigation
taddy_919
2
1.9k
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
130
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
0
100
10Xにおける品質保証活動の全体像と改善 #no_more_wait_for_test
nihonbuson
PRO
2
200
データの整合性を保ちたいだけなんだ
shoheimitani
8
2.9k
Frontier Agents (Kiro autonomous agent / AWS Security Agent / AWS DevOps Agent) の紹介
msysh
3
150
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
1.6k
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
380
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
(金融庁共催)第4回金融データ活用チャレンジ勉強会資料
takumimukaiyama
0
130
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
560
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.1k
Deep Space Network (abreviated)
tonyrice
0
45
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Color Theory Basics | Prateek | Gurzu
gurzu
0
190
We Are The Robots
honzajavorek
0
160
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
120
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Building Applications with DynamoDB
mza
96
6.9k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
0
310
Facilitating Awesome Meetings
lara
57
6.7k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
82
Transcript
PROXY Protocol Aware Proxy Server on Node.js Kyoto.js #16 @moznion
@moznion Software engineer
PROXY Protocol
Proxy PROTOCOL - Transport Layer (L4) ൛ͷX-Forwarder-For - Proxy͢ΔࡍʹoriginalͷΞυϨεΛҡ࣋ͯ͠ ѼઌϑΥϫʔυ͢ΔͨΊͷϓϩτίϧ
- HAProxy͕ఏএ (ۀքඪ४Έ͍ͨͳʁ) - http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt - AWSͷELBͰαϙʔτͯ͠Δ - V1ͱV2͕͋Δ (ޙड़)
PROXY Protocol V1
Proxy PROTOCOL V1 - ςΩετϓϩτίϧ - ϑΥʔϚοτ: PROXY <INET Protocol
Family> <Source Address> <Destination Address> <Source Port> <Destination Port>\r\n - Θ͔Γ͍͢Ͱ͢Ͷ
PROXY Protocol V2
Proxy PROTOCOL V2 - όΠφϦϓϩτίϧ - આ໌ུ (ͪΐͬͱ໘͍͘͞) - V1ͱͷػೳ໘Ͱͷେ͖ͳࠩUNIX
Domain SocketΛαϙʔτ͍ͯ͠Δ͔Ͳ͏͔
Example (V1)
Example (V1) PROXY TCP4 192.168.0.1 192.168.0.11 56324 443\r\n GET /
HTTP/1.1\r\n Host: 192.168.0.11\r\n \r\n
Example (V1) PROXY TCP4 192.168.0.1 192.168.0.11 56324 443\r\n GET /
HTTP/1.1\r\n Host: 192.168.0.11\r\n \r\n طଘͷ௨৴ͷΞλϚʹprepend͢Δ
Proxy PROTOCOL - طଘͷ௨৴ͷΞλϚʹprepend͢Δ - γϯϓϧʂ - => ૹ৴ݩૹ৴ઌʮPROXY ProtocolΛ͏ʯ
ͱ͍͏͜ͱΛࣄલʹ͓ͬͯ͘ඞཁ༗Γ - ͞ͳ͍ͱͿͬյΕΔ
Motivation
nodeͰΓ͍ͨΜʁ ʢੈͷதʹ৭ʑͳ͜ͱ͕͋Δʣ
proxy-protocol-js - ͱ͍͏Θ͚Ͱॻ͍ͨ - https://github.com/moznion/proxy-protocol-js - TypeScript - V1/V2྆ରԠ -
encode/decode྆ରԠ
proxy-protocol-js - ۤ࿑ϙΠϯτ:
Example Implementation and Demo
https://github.com/moznion/proxy- protocol-socket-server-example