{"id":11123,"date":"2024-05-03T10:55:07","date_gmt":"2024-05-03T14:55:07","guid":{"rendered":"https:\/\/www.redline13.com\/blog\/?p=11123"},"modified":"2024-05-03T10:55:08","modified_gmt":"2024-05-03T14:55:08","slug":"using-x-forwarded-for-in-jmeter","status":"publish","type":"post","link":"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/","title":{"rendered":"Using X-Forwarded-For in JMeter"},"content":{"rendered":"<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-11124\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/05\/word-image-11123-1.png\" alt=\"Using X-Forwarded-For in JMeter\" width=\"400\" height=\"300\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/05\/word-image-11123-1.png 400w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/05\/word-image-11123-1-300x225.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/strong><\/p>\n<p>It is not uncommon for network access rules to restrict traffic from undifferentiated traffic from major cloud providers. Such a practice for public-facing applications is a reasonable security measure. However, this can pose some challenges when performing load testing, especially with scale as these resources typically originate from within a large data center. In this brief article, we will show you how to set up <a href=\"https:\/\/en.wikipedia.org\/wiki\/X-Forwarded-For\" target=\"_blank\" rel=\"noopener\"><strong><code>X-Forwarded-For<\/code><\/strong><\/a>\u00a0headers in <a href=\"https:\/\/jmeter.apache.org\/usermanual\/\" target=\"_blank\" rel=\"noopener\">JMeter<\/a> to help navigate this issue and allow your requests to reach your target test application.<\/p>\n<h3><a id=\"post-11123-_5o8vij3i292k\"><\/a>When to Use X-Forwarded-For Headers<\/h3>\n<p>If you are using a cloud-based load testing platform like <a href=\"https:\/\/www.redline13.com\/\" target=\"_blank\" rel=\"noopener\">RedLine13<\/a>, there is a good chance that load generator instances reside within a cloud-based infrastructure such as <a href=\"https:\/\/aws.amazon.com\/\" target=\"_blank\" rel=\"noopener\">AWS<\/a>. Owing to that, it is not uncommon for organization security policies to restrict traffic originating from undifferentiated cloud providers. One method to allow your traffic to pass through access control lists (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Access-control_list\" target=\"_blank\" rel=\"noopener\">ACLs<\/a>) and reach your target test servers is to use the <code>X-Forwarded-For<\/code> header.<\/p>\n<p>When an <code>X-Forwarded-For<\/code> header is set, it informs the network where a request originated from. It is often used by proxy servers to identify underlying sources of forwarded requests. Similarly, it can be used to identify approved sources of traffic for requests originating from cloud provider networks.<\/p>\n<h3><a id=\"post-11123-_t0ttwdhj6k7z\"><\/a>Setting X-Forwarded-For Headers<\/h3>\n<p>JMeter has a component called the <a href=\"https:\/\/jmeter.apache.org\/usermanual\/component_reference.html#HTTP_Header_Manager\" target=\"_blank\" rel=\"noopener\"><em>HTTP Header Manager<\/em><\/a>, which allows you to add or replace headers for associated HTTP requests. For the specific example of <code>X-Forwarded-For<\/code> headers, we can define the header name, and set the value to a desired IP address as shown below:<\/p>\n<figure id=\"attachment_11125\" class=\"wp-caption aligncenter\" style=\"max-width: 536px\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-11125\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/05\/word-image-11123-2.png\" alt=\"Setting the X-Forwarded-For header in JMeter using the HTTP Header Manager\" width=\"536\" height=\"352\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/05\/word-image-11123-2.png 536w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/05\/word-image-11123-2-300x197.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/05\/word-image-11123-2-425x279.png 425w\" sizes=\"auto, (max-width: 536px) 100vw, 536px\" \/><figcaption class=\"wp-caption-text\">Setting the X-Forwarded-For header in JMeter using the HTTP Header Manager.<\/figcaption><\/figure>\n<p>In this case, associated HTTP requests will be treated as if they originated from the IP address <code>13.224.214.30<\/code>, versus an organic request from the actual IP of the instance. The caveat is of course that the implementation of ACL rules must honor presented <code>X-Forwarded-For<\/code> addresses.<\/p>\n<hr \/>\n<p>Did you know that RedLine13 offers a full-featured, time-limited free trial? <a href=\"https:\/\/www.redline13.com\/Service\" target=\"_blank\" rel=\"noopener\">Sign up now<\/a>, and start testing today!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is not uncommon for network access rules to restrict traffic from undifferentiated traffic from major cloud providers. Such a practice for public-facing applications is a reasonable security measure. However, this can pose some challenges when performing load testing, especially with scale as these resources typically originate from within a large data center. In this brief article, we will show you how to set up X-Forwarded-For\u00a0headers in JMeter to help navigate this issue and allow your<a class=\"more-link\" href=\"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/\">Read More &rarr;<\/a><\/p>\n","protected":false},"author":11,"featured_media":11124,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,1],"tags":[88,128,710,667,283,711,318,424,709],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-dkoziel","4":"post-11123","6":"format-standard","7":"has-post-thumbnail","8":"category-blog","9":"category-uncategorized","10":"post_tag-aws","11":"post_tag-cloud-load-testing","12":"post_tag-http-header-manager","13":"post_tag-http-requests","14":"post_tag-jmeter","15":"post_tag-jmeter-headers","16":"post_tag-load-testing","17":"post_tag-redline13","18":"post_tag-x-forwarded-for"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.12 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using X-Forwarded-For in JMeter - RedLine13<\/title>\n<meta name=\"description\" content=\"In this brief article, we will show you how to use X-Forwarded-For headers in JMeter to allow requests to reach their targets.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using X-Forwarded-For in JMeter - RedLine13\" \/>\n<meta property=\"og:description\" content=\"In this brief article, we will show you how to use X-Forwarded-For headers in JMeter to allow requests to reach their targets.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/\" \/>\n<meta property=\"og:site_name\" content=\"RedLine13\" \/>\n<meta property=\"article:published_time\" content=\"2024-05-03T14:55:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-03T14:55:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/05\/word-image-11123-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"David Koziel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Koziel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/\"},\"author\":{\"name\":\"David Koziel\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\"},\"headline\":\"Using X-Forwarded-For in JMeter\",\"datePublished\":\"2024-05-03T14:55:07+00:00\",\"dateModified\":\"2024-05-03T14:55:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/\"},\"wordCount\":336,\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"keywords\":[\"AWS\",\"Cloud Load Testing\",\"HTTP Header Manager\",\"HTTP Requests\",\"JMeter\",\"JMeter Headers\",\"Load Testing\",\"RedLine13\",\"X-Forwarded-For\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/\",\"name\":\"Using X-Forwarded-For in JMeter - RedLine13\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\"},\"datePublished\":\"2024-05-03T14:55:07+00:00\",\"dateModified\":\"2024-05-03T14:55:08+00:00\",\"description\":\"In this brief article, we will show you how to use X-Forwarded-For headers in JMeter to allow requests to reach their targets.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.redline13.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using X-Forwarded-For in JMeter\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"name\":\"RedLine13\",\"description\":\"(Almost) Free Load Testing in the Cloud\",\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.redline13.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\",\"name\":\"RedLine13\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"contentUrl\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"width\":300,\"height\":68,\"caption\":\"RedLine13\"},\"image\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\",\"name\":\"David Koziel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"caption\":\"David Koziel\"},\"url\":\"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using X-Forwarded-For in JMeter - RedLine13","description":"In this brief article, we will show you how to use X-Forwarded-For headers in JMeter to allow requests to reach their targets.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/","og_locale":"en_US","og_type":"article","og_title":"Using X-Forwarded-For in JMeter - RedLine13","og_description":"In this brief article, we will show you how to use X-Forwarded-For headers in JMeter to allow requests to reach their targets.","og_url":"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/","og_site_name":"RedLine13","article_published_time":"2024-05-03T14:55:07+00:00","article_modified_time":"2024-05-03T14:55:08+00:00","og_image":[{"width":400,"height":300,"url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/05\/word-image-11123-1.png","type":"image\/png"}],"author":"David Koziel","twitter_card":"summary_large_image","twitter_misc":{"Written by":"David Koziel","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/#article","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/"},"author":{"name":"David Koziel","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20"},"headline":"Using X-Forwarded-For in JMeter","datePublished":"2024-05-03T14:55:07+00:00","dateModified":"2024-05-03T14:55:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/"},"wordCount":336,"publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"keywords":["AWS","Cloud Load Testing","HTTP Header Manager","HTTP Requests","JMeter","JMeter Headers","Load Testing","RedLine13","X-Forwarded-For"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/","url":"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/","name":"Using X-Forwarded-For in JMeter - RedLine13","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/#website"},"datePublished":"2024-05-03T14:55:07+00:00","dateModified":"2024-05-03T14:55:08+00:00","description":"In this brief article, we will show you how to use X-Forwarded-For headers in JMeter to allow requests to reach their targets.","breadcrumb":{"@id":"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.redline13.com\/blog\/2024\/05\/using-x-forwarded-for-in-jmeter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.redline13.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Using X-Forwarded-For in JMeter"}]},{"@type":"WebSite","@id":"https:\/\/www.redline13.com\/blog\/#website","url":"https:\/\/www.redline13.com\/blog\/","name":"RedLine13","description":"(Almost) Free Load Testing in the Cloud","publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.redline13.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.redline13.com\/blog\/#organization","name":"RedLine13","url":"https:\/\/www.redline13.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","contentUrl":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","width":300,"height":68,"caption":"RedLine13"},"image":{"@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20","name":"David Koziel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","caption":"David Koziel"},"url":"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/"}]}},"_links":{"self":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/comments?post=11123"}],"version-history":[{"count":2,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11123\/revisions"}],"predecessor-version":[{"id":11127,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11123\/revisions\/11127"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media\/11124"}],"wp:attachment":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media?parent=11123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/categories?post=11123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/tags?post=11123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}