31
Web Proxy Filtering and Caching / Re: [HAPROXY] websocket upgrade
« on: June 09, 2022, 07:21:47 pm »
I just pick up the following section and explain what he have done
He created 4 condition
1. Name=Websocket_Upgrade, Condition type=Custom condition (Option pass-through), Option pass-through=hdr(Connection) -i Upgrade
2. Name=Websocket, Condition type=Custom condition (Option pass-through), Option pass-through=hdr(Upgrade) -i WebSocket
3. Name=Websocket_WS, Condition type=Custom condition (Option pass-through), Option pass-through=hdr_beg(host) -i ws
4. Name=Emby_Webserver, Condition type=Custom condition (Option pass-through), Option pass-through=hdr_sub(host) -i example.com
He created 2 rules
1. Name=Emby_Websocket, Test type=IF, Select conditions=Websocket_Upgrade+Websocket+Websocket_WS, Logical operator for conditions=AND, Execute function=Use Specified Backend Pool, Use backend pool=Emby_Webserver
2. Name=Emby_WebServer, Test type=IF, Select conditions=Emby_Webserver, Execute function=Use Specified Backend Pool, Use backend pool=Emby_Webserver
He put these 2 rule into Frontend: HTTPS (Front End HTTPS), with the following order
Emby_Websocket in front, then Emby_WebServer
Code: [Select]
# ACL: Websocket_Upgrade
acl acl_61bfe65d4066b0.98106842 hdr(Connection) -i Upgrade
# ACL: Websocket
acl acl_61bfe67f211b51.96043088 hdr(Upgrade) -i WebSocket
# ACL: Websocket_WS
acl acl_61c0e62bc10459.22208791 hdr_beg(host) -i ws
# ACL: Emby_Webserver
acl acl_5e811fc593d624.87923872 hdr_sub(host) -i example.com
# ACTION: Emby_Websocket
use_backend Emby_Webserver if acl_61bfe65d4066b0.98106842 acl_61bfe67f211b51.96043088 acl_61c0e62bc10459.22208791
# ACTION: Emby_WebServer
use_backend Emby_Webserver if acl_5e811fc593d624.87923872
he already have a websock backend called "Emby_Webserver"He created 4 condition
1. Name=Websocket_Upgrade, Condition type=Custom condition (Option pass-through), Option pass-through=hdr(Connection) -i Upgrade
2. Name=Websocket, Condition type=Custom condition (Option pass-through), Option pass-through=hdr(Upgrade) -i WebSocket
3. Name=Websocket_WS, Condition type=Custom condition (Option pass-through), Option pass-through=hdr_beg(host) -i ws
4. Name=Emby_Webserver, Condition type=Custom condition (Option pass-through), Option pass-through=hdr_sub(host) -i example.com
He created 2 rules
1. Name=Emby_Websocket, Test type=IF, Select conditions=Websocket_Upgrade+Websocket+Websocket_WS, Logical operator for conditions=AND, Execute function=Use Specified Backend Pool, Use backend pool=Emby_Webserver
2. Name=Emby_WebServer, Test type=IF, Select conditions=Emby_Webserver, Execute function=Use Specified Backend Pool, Use backend pool=Emby_Webserver
He put these 2 rule into Frontend: HTTPS (Front End HTTPS), with the following order
Emby_Websocket in front, then Emby_WebServer