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.7k
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
12k
「データ無い! 腹立つ! 推論する!」から 「データ無い! 腹立つ! データを作る」へ チームでデータを作り、育てられるようにするまで / How can we create, use, and maintain data ourselves?
moznion
11
7.1k
避けられないI/O待ちに対処する: Rails アプリにおけるSSEとasync gemの活用 / Tackling Inevitable I/O Latency in Rails Apps with SSE and the async gem
moznion
4
6k
RubyKaigi Hack Space in Tokyo & 函館最速 "予習" 会 / RubyKaigi Hack Space in Tokyo & The Fastest Briefing of RubyKaigi 2026 in Hakodate
moznion
1
370
地に足の付いた現実的な技術選定から魔力のある体験を得る『AIレシート読み取り機能』のケーススタディ / From Grounded Tech Choices to Magical UX: A Case Study of AI Receipt Scanning
moznion
7
4.8k
Chrome Extension Techniques from Hell
moznion
1
280
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
4
8.6k
AIレシート読み取り機能をRuby on Rails on AWSで実現するLLMにまつわるアレコレ / AI-based receipt reading function powered by LLM on Ruby on Rails on AWS
moznion
3
1.2k
Develop to Survive - YAPC::Hakodate 2024 Keynote
moznion
11
23k
Other Decks in Technology
See All in Technology
夢の無限スパゲッティ製造機 #phperkaigi
o0h
PRO
0
390
CloudFrontのHost Header転送設定でパケットの中身はどう変わるのか?
nagisa53
1
220
SSoT(Single Source of Truth)で「壊して再生」する設計
kawauso
2
400
「お金で解決」が全てではない!大規模WebアプリのCI高速化 #phperkaigi
stefafafan
5
2.4k
ブラックボックス化したMLシステムのVertex AI移行 / mlops_community_62
visional_engineering_and_design
1
230
昔話で振り返るAWSの歩み ~S3誕生から20年、クラウドはどう進化したのか~
nrinetcom
PRO
0
120
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
4
1.3k
RGBに陥らないために -プロダクトの価値を届けるまで-
righttouch
PRO
0
130
TUNA Camp 2026 京都Stage ヒューリスティックアルゴリズム入門
terryu16
0
610
GitHub Actions侵害 — 相次ぐ事例を振り返り、次なる脅威に備える
flatt_security
8
6.3k
互換性のある(らしい)DBへの移行など考えるにあたってたいへんざっくり
sejima
PRO
0
310
なぜarray_firstとarray_lastは採用、 array_value_firstとarray_value_lastは 見送りだったか / Why array_value_first and array_value_last was declined, then why array_first and array_last was accpeted?
cocoeyes02
0
270
Featured
See All Featured
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Making Projects Easy
brettharned
120
6.6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
Everyday Curiosity
cassininazir
0
180
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
440
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
First, design no harm
axbom
PRO
2
1.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
250
Six Lessons from altMBA
skipperchong
29
4.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
990
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