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.7k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PROXY Protocol aware Proxy Server on Node.js
This slides for Kyoto.js #16
moznion
April 27, 2019
More Decks by moznion
See All by moznion
reFACToring
moznion
1
1.2k
cccccc
moznion
1
2.5k
履歴テーブル、今回はこう作りました 〜 Delegated Types編 〜 / How We Built Our History Table This Time — With Delegated Types
moznion
16
15k
「データ無い! 腹立つ! 推論する!」から 「データ無い! 腹立つ! データを作る」へ チームでデータを作り、育てられるようにするまで / How can we create, use, and maintain data ourselves?
moznion
11
7.5k
避けられないI/O待ちに対処する: Rails アプリにおけるSSEとasync gemの活用 / Tackling Inevitable I/O Latency in Rails Apps with SSE and the async gem
moznion
4
9.1k
RubyKaigi Hack Space in Tokyo & 函館最速 "予習" 会 / RubyKaigi Hack Space in Tokyo & The Fastest Briefing of RubyKaigi 2026 in Hakodate
moznion
1
450
地に足の付いた現実的な技術選定から魔力のある体験を得る『AIレシート読み取り機能』のケーススタディ / From Grounded Tech Choices to Magical UX: A Case Study of AI Receipt Scanning
moznion
7
5.2k
Chrome Extension Techniques from Hell
moznion
1
330
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
4
9k
Other Decks in Technology
See All in Technology
作って理解するCoding Agent 〜フレームワークに頼らないピュア Python での実装〜
takapy
2
140
巨大気象データと戦う ― サロゲートモデル学習を高速化する圧縮技術
gpuunite_official
0
170
AIに持続⼒を与える 判断の⻑期記憶設計
eiei114
1
430
ハッカソンで入賞した話 @ Findy LT
asari194617
0
1.4k
ソフトウェアサプライチェーンの構造的リスクとコンテナ環境の保護
kyohmizu
5
740
LLM・AIエージェントシステムベストプラクティス
shibuiwilliam
6
1.6k
Invisible to AI? Making TYPO3 Sites Quotable by AI Search Systems
wolfgangwagner
0
240
カートの信頼性を担保するWireMockを使ったe2eテスト
ykagano
0
620
2027年のMetricKit
kantacky
0
130
Bill One 開発エンジニア 紹介資料
sansan33
PRO
7
20k
ホームラボ紹介
y_sera15
0
220
案件に一番詳しいAIを Amazon Bedrock AgentCore で作る ― 知見が知見を生むチームへ / Compounding Knowledge with AgentCore
yusukeshimizu
1
160
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
550
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
300
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
630
Documentation Writing (for coders)
carmenintech
77
5.5k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
350
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
480
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
220
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
500
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