Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haproxy: T7081: Support HTTP compression #4314

Merged
merged 1 commit into from
Jan 27, 2025
Merged

Conversation

Embezzle
Copy link
Contributor

Change summary

Add support for HTTP compression in HAProxy responses.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

https://vyos.dev/T7081

Related PR(s)

How to test / Smoketest result

Test Steps

  1. Configure haproxy using the new options:
set load-balancing haproxy service fe-01 listen-address '127.0.0.1'
set load-balancing haproxy service fe-01 port '80'
set load-balancing haproxy service fe-01 mode 'http'
set load-balancing haproxy service fe-01 http-compression algorithm 'gzip'
set load-balancing haproxy service fe-01 http-compression mime-type 'text/html'
set load-balancing haproxy service fe-01 http-compression mime-type 'text/css'
set load-balancing haproxy service fe-01 backend 'bk-01'

set load-balancing haproxy backend bk-01 mode 'http'
set load-balancing haproxy backend bk-01 server srv-01 address '127.0.0.1'
set load-balancing haproxy backend bk-01 server srv-01 port '8080'
  1. Check haproxy.cfg is showing the correct configuration:
vyos@vyos:~$ cat /var/run/haproxy/haproxy.cfg | grep -A 2 'filter compression'
filter compression
compression algo gzip
compression type text/html text/css

Smoke Test

vyos@vyos:~$ python3 /usr/libexec/vyos/tests/smoke/cli/test_load-balancing_haproxy.py
test_01_lb_reverse_proxy_domain (__main__.TestLoadBalancingReverseProxy.test_01_lb_reverse_proxy_domain) ... ok
test_02_lb_reverse_proxy_cert_not_exists (__main__.TestLoadBalancingReverseProxy.test_02_lb_reverse_proxy_cert_not_exists) ... ok
test_03_lb_reverse_proxy_ca_not_exists (__main__.TestLoadBalancingReverseProxy.test_03_lb_reverse_proxy_ca_not_exists) ... ok
test_04_lb_reverse_proxy_backend_ssl_no_verify (__main__.TestLoadBalancingReverseProxy.test_04_lb_reverse_proxy_backend_ssl_no_verify) ... ok
test_05_lb_reverse_proxy_backend_http_check (__main__.TestLoadBalancingReverseProxy.test_05_lb_reverse_proxy_backend_http_check) ... ok
test_06_lb_reverse_proxy_tcp_mode (__main__.TestLoadBalancingReverseProxy.test_06_lb_reverse_proxy_tcp_mode) ... ok
test_07_lb_reverse_proxy_http_response_headers (__main__.TestLoadBalancingReverseProxy.test_07_lb_reverse_proxy_http_response_headers) ... ok
test_08_lb_reverse_proxy_tcp_health_checks (__main__.TestLoadBalancingReverseProxy.test_08_lb_reverse_proxy_tcp_health_checks) ... ok
test_09_lb_reverse_proxy_logging (__main__.TestLoadBalancingReverseProxy.test_09_lb_reverse_proxy_logging) ... ok
test_10_lb_reverse_proxy_http_compression (__main__.TestLoadBalancingReverseProxy.test_10_lb_reverse_proxy_http_compression) ... ok

----------------------------------------------------------------------
Ran 10 tests in 53.303s

OK

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

github-actions bot commented Jan 23, 2025

👍
No issues in PR Title / Commit Title

Copy link

CI integration 👍 passed!

Details

CI logs

  • CLI Smoketests (no interfaces) 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

@sever-sever sever-sever merged commit 85be757 into vyos:current Jan 27, 2025
13 of 14 checks passed
@Embezzle Embezzle deleted the T7081 branch January 27, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants