add proxy_host and proxy_port for FastHttpUser

This commit is contained in:
Nicolas Adrian 2024-06-10 11:24:45 +02:00
parent 3d2169192c
commit a665132b23
3 changed files with 11 additions and 1 deletions

View File

@ -111,7 +111,7 @@ FastHttpUser class
--------------------
.. autoclass:: locust.contrib.fasthttp.FastHttpUser
:members: network_timeout, connection_timeout, max_redirects, max_retries, insecure, concurrency, client_pool, rest, rest_
:members: network_timeout, connection_timeout, max_redirects, max_retries, insecure, proxy_host, proxy_port, concurrency, client_pool, rest, rest_
FastHttpSession class

View File

@ -14,6 +14,8 @@ class WebsiteUser(FastHttpUser):
# max_redirects = 5
# max_retries = 1
# network_timeout = 60.0
# proxy_host = my-proxy.com
# proxy_port = 8080
@task
def index(self):

View File

@ -324,6 +324,12 @@ class FastHttpUser(User):
Note that setting this value has no effect when custom client_pool was given, and you need to spawn a your own gevent pool
to use it (as Users only have one greenlet). See test_fasthttp.py / test_client_pool_concurrency for an example."""
proxy_host: str | None = None
"""Parameter passed to FastHttpSession"""
proxy_port: int | None = None
"""Parameter passed to FastHttpSession"""
client_pool: HTTPClientPool | None = None
"""HTTP client pool to use. If not given, a new pool is created per single user."""
@ -355,6 +361,8 @@ class FastHttpUser(User):
client_pool=self.client_pool,
ssl_context_factory=self.ssl_context_factory,
headers=self.default_headers,
proxy_host=self.proxy_host,
proxy_port=self.proxy_port,
)
"""
Instance of HttpSession that is created upon instantiation of User.