Skip to content

Nighthawk_client supports http_proxy and https_proxy #1063

@xiaohui1wang

Description

@xiaohui1wang

Nighthawk_client supports http_proxy and https_proxy.

Assume there is a scenario to use nighthawk_client to test a URL, such as: https://example.com/index.html, but nighthawk_client cannot access "https://example.com/index.html" directly, it needs a proxy server with username and password authentication.
I tried to setup OS environment http_proxy and https_proxy, it doesn't work.
So, is there a way to setup http_proxy and https_proxy for nighthawk_client ? Thanks!

Below is error logs:
./nighthawk_client https://getnighthawk.dev/assets/images/logos/nighthawk/horizontal/nighthawk-text-side.svg
[18:50:40.109348][466408][I] Starting 1 threads / event loops. Time limit: 5 seconds.
[18:50:40.109396][466408][I] Global targets: 100 connections and 5 calls per second.
[18:50:40.879589][466417][E] Exiting due to failing termination predicate
[18:50:40.879612][466417][I] Stopping after 100 ms. Initiated: 1 / Completed: 1. (Completion rate was 9.93226197334181 per second.)
[18:50:41.141247][466408][E] Terminated early because of a failure predicate.
[18:50:41.141269][466408][I] Check the output for problematic counter values. The default Nighthawk failure predicates report failure if (1) Nighthawk could not connect to the target (see 'benchmark.pool_connection_failure' counter; check the address and port number, and try explicitly setting --address-family v4 or v6, especially when using DNS; instead of localhost try 127.0.0.1 or ::1 explicitly), (2) the protocol was not supported by the target (see 'benchmark.stream_resets' counter; check http/https in the URI, --h2), (3) the target returned a 4xx or 5xx HTTP response code (see 'benchmark.http_4xx' and 'benchmark.http_5xx' counters; check the URI path and the server config), or (4) a custom gRPC RequestSource failed. --failure-predicate can be used to relax expectations.
Nighthawk - A layer 7 protocol benchmarking tool.

Initiation to completion (1 samples)
min: 0s 000ms 608us | mean: 0s 000ms 608us | max: 0s 000ms 608us | pstdev: 0s 000ms 000us

Counter Value Per second
benchmark.pool_connection_failure 1 9.93
cluster_manager.cluster_added 1 9.93
default.total_match_count 1 9.93
membership_change 1 9.93
runtime.load_success 1 9.93
runtime.override_dir_not_exists 1 9.93
sequencer.failed_terminations 1 9.93
upstream_cx_connect_fail 1 9.93
upstream_cx_destroy 1 9.93
upstream_cx_destroy_remote 1 9.93
upstream_cx_http1_total 1 9.93
upstream_cx_total 1 9.93
upstream_rq_pending_failure_eject 1 9.93
upstream_rq_pending_total 1 9.93

[18:50:41.147032][466408][E] An error ocurred.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions