{"id":79287,"date":"2025-08-06T12:38:08","date_gmt":"2025-08-06T11:38:08","guid":{"rendered":"https:\/\/proxidize.com\/?post_type=blog&#038;p=79287"},"modified":"2025-10-23T11:42:28","modified_gmt":"2025-10-23T10:42:28","slug":"curl-with-proxy","status":"publish","type":"blog","link":"https:\/\/proxidize.com\/blog\/curl-with-proxy\/","title":{"rendered":"How to Use cURL with Proxy"},"content":{"rendered":"\n<p>As a developer, you do a lot of debugging, testing of geo-restricted content, and routing traffic through a proxy server for privacy or compliance. Using <strong>cURL can make it much easier <\/strong>to work from behind a proxy.<\/p>\n\n\n\n<p>With just a few flags,<strong> you can tell cURL to send traffic through HTTP or SOCKS proxies <\/strong>with or without authentication. Since cURL supports everything from simple IP:port pairs to full proxy credentials, it\u2019s a<strong> great option for developers<\/strong>.<\/p>\n\n\n\n<p>In this guide, we\u2019ll walk through the different ways to use <a href=\"https:\/\/proxidize.com\/blog\/what-is-curl\/\" target=\"_blank\" rel=\"noreferrer noopener\">cURL<\/a> with proxy servers, including:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>How to use HTTP and SOCKS5 proxies<\/strong><\/li>\n\n\n\n<li><strong>How to pass authentication credentials<\/strong><\/li>\n\n\n\n<li><strong>How to verify that your requests are actually being routed through the proxy<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Using cURL you can use both HTTP and SOCKS proxies with just a few flags.<\/p>\n\n\n\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized centered\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"536\" src=\"https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-an-http-proxy-with-curl-img-1024x536.jpg\" alt=\"A drawing of a server and a shield showing HTTP and a terminal icon under the title &quot;How to Use an HTTP Proxy with cURL&quot;.\" class=\"wp-image-79291\" style=\"object-fit:cover\" srcset=\"https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-an-http-proxy-with-curl-img-1024x536.jpg 1024w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-an-http-proxy-with-curl-img-300x157.jpg 300w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-an-http-proxy-with-curl-img-768x402.jpg 768w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-an-http-proxy-with-curl-img-600x314.jpg 600w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-an-http-proxy-with-curl-img.jpg 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use an HTTP Proxy with cURL<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">cURL HTTP Proxy without Authentication<\/h3>\n\n\n\n<p>Using an <a href=\"https:\/\/proxidize.com\/proxy-server\/http-proxies\/\" target=\"_blank\" rel=\"noreferrer noopener\">HTTP proxy<\/a> with cURL is straightforward. You just need to pass the proxy address using the <code>-x<\/code> or <code>--proxy<\/code> flag.<\/p>\n\n\n\n<p><strong>Basic Syntax:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl -x http:\/\/proxyhost:port https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">-x<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">http:\/\/proxyhost:port<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl -x http:\/\/192.168.1.100:8080 https:\/\/httpbin.org\/ip<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">-x<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">http:\/\/192.168.1.100:8080<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/httpbin.org\/ip<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>In the example above:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>-x<\/code> tells cURL to use a proxy<\/li>\n\n\n\n<li>http:\/\/192.168.1.100:8080 is the proxy server<\/li>\n\n\n\n<li>The request to https:\/\/httpbin.org\/ip will go through the proxy<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">CURL HTTP Proxy with Authentication<\/h3>\n\n\n\n<p>If your proxy requires a username and password, include them in the proxy URL:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl -x http:\/\/username:password@proxyhost:port https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">-x<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">http:\/\/username:password@proxyhost:port<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl -x http:\/\/user123:pass456@192.168.1.100:8080 https:\/\/httpbin.org\/ip<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">-x<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">http:\/\/user123:pass456@192.168.1.100:8080<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/httpbin.org\/ip<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>When to use:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Your network requires traffic to go through an internal proxy<\/li>\n\n\n\n<li>You want to test how your API behaves from a different location\/<a href=\"https:\/\/proxidize.com\/blog\/what-is-an-ip-address\/\" target=\"_blank\" data-type=\"blog\" data-id=\"83356\" rel=\"noreferrer noopener\">IP address<\/a><\/li>\n\n\n\n<li>You\u2019re debugging traffic that passes through CDN or proxy layers<\/li>\n<\/ul>\n\n\n\n<p><strong>Security tip:<\/strong> Avoid pasting proxy credentials directly into the command line. You can use <code>--proxy-user<\/code> instead:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --proxy http:\/\/proxyhost:port --proxy-user user:pass https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">http:\/\/proxyhost:port<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy-user<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">user:pass<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized centered\"><img decoding=\"async\" width=\"1024\" height=\"536\" src=\"https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-a-socks-proxy-with-curl-img-1024x536.jpg\" alt=\"A drawing of a laptop connecting through a sock to a server under the title &quot;How to use a SOCKS PRoxy with cURL?&quot;.\" class=\"wp-image-79290\" style=\"object-fit:cover\" srcset=\"https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-a-socks-proxy-with-curl-img-1024x536.jpg 1024w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-a-socks-proxy-with-curl-img-300x157.jpg 300w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-a-socks-proxy-with-curl-img-768x402.jpg 768w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-a-socks-proxy-with-curl-img-600x314.jpg 600w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-a-socks-proxy-with-curl-img.jpg 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use a SOCKS Proxy with cURL?<\/h2>\n\n\n\n<p><a href=\"https:\/\/proxidize.com\/proxy-server\/socks-proxy\/\" target=\"_blank\" rel=\"noreferrer noopener\">SOCKS proxies<\/a> operate at a lower level than HTTP proxies, making them perfect for routing any kind of traffic, not just HTTP. This is especially handy when testing applications, accessing geo-restricted content, or tunneling traffic securely through another server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">cURL SOCKS Proxy without Authentication<\/h3>\n\n\n\n<p>You can use <code>--socks5<\/code>, <code>--socks4<\/code>, or <code>socks5-hostname<\/code> depending on the version of SOCKS and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Domain_Name_System\" target=\"_blank\" rel=\"noreferrer noopener\">DNS<\/a> resolution behavior.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --socks5 socks_host:port https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--socks5<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">socks_host:port<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --socks5 127.0.0.1:9050 https:\/\/httpbin.org\/ip<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--socks5<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #EA9A97\">127.0<\/span><span style=\"color: #F6C177\">.0.1:9050<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/httpbin.org\/ip<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>This tells cURL to route traffic through the SOCKS5 proxy running locally on port <code>9050<\/code> (which is the default port for Tor).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">cURL SOCKS Proxy with Authentication<\/h3>\n\n\n\n<p>If the SOCKS proxy requires a username and a password:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --socks5-user user --socks5-password pass --socks5 socks_host:port https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--socks5-user<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">user<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--socks5-password<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">pass<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--socks5<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">socks_host:port<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --socks5-user myuser --socks5-password mypass --socks5 192.168.0.5:1080 https:\/\/httpbin.org\/ip<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--socks5-user<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">myuser<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--socks5-password<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">mypass<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--socks5<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #EA9A97\">192.168<\/span><span style=\"color: #F6C177\">.0.5:1080<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/httpbin.org\/ip<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized centered\"><img decoding=\"async\" width=\"1024\" height=\"536\" src=\"https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/socks-vs-http-proxy-with-curl-img-1024x536.jpg\" alt=\"a blue and purple neon diagram under the title &quot;SOCKS vs HTTP Proxy with cURL&quot;.\" class=\"wp-image-79293\" style=\"object-fit:cover\" srcset=\"https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/socks-vs-http-proxy-with-curl-img-1024x536.jpg 1024w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/socks-vs-http-proxy-with-curl-img-300x157.jpg 300w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/socks-vs-http-proxy-with-curl-img-768x402.jpg 768w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/socks-vs-http-proxy-with-curl-img-600x314.jpg 600w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/socks-vs-http-proxy-with-curl-img.jpg 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">SOCKS vs HTTP Proxy with cURL<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Feature<\/th><th>HTTP Proxy<\/th><th>SOCKS Proxy<\/th><\/tr><\/thead><tbody><tr><td>Protocol-specific<\/td><td>Yes (HTTP\/S only)<\/td><td>No (can proxy any protocol)<\/td><\/tr><tr><td>DNS resolution control<\/td><td>Limited<\/td><td>More flexible (<a href=\"https:\/\/proxidize.com\/blog\/what-is-proxy-hostname\/\" target=\"_blank\" rel=\"noreferrer noopener\">hostname<\/a> vs IP)<\/td><\/tr><tr><td>Use cases<\/td><td>APIs, web requests<\/td><td>Full tunneling, Tor, dev\/test<\/td><\/tr><tr><td>Supported in cURL<\/td><td>Yes<\/td><td>Yes (with <code>--socks5<\/code>, etc.)<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\"><em>Source: <a href=\"https:\/\/proxidize.com\/blog\/curl-with-proxy\/\" data-type=\"link\" data-id=\"https:\/\/proxidize.com\/blog\/curl-with-proxy\/\">Proxidize<\/a><\/em><\/figcaption><\/figure>\n\n\n\n<div style=\"height:12px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong><code>--socks5-hostname<\/code> vs <code>--socks5<\/code><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>&#8211;socks5: DNS resolution happens on the client side.<\/li>\n\n\n\n<li>&#8211;socks5-hostname: DNS resolution happens on the proxy side.<\/li>\n<\/ul>\n\n\n\n<p><strong>Use <code>--socks5-hostname<\/code> when:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You want to hide DNS queries from your ISP.<\/li>\n\n\n\n<li>You&#8217;re using a remote proxy (e.g., Tor node, VPN, or remote gateway).<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --socks5-hostname 127.0.0.1:9050 https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--socks5-hostname<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #EA9A97\">127.0<\/span><span style=\"color: #F6C177\">.0.1:9050<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized centered\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"536\" src=\"https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-an-https-proxy-with-curl-img-1024x536.jpg\" alt=\"A drawing of a laptop and server connected to a shield icon under the title &quot;How to Use an HTTPS Proxy with cURL&quot;.\" class=\"wp-image-79292\" style=\"object-fit:cover\" srcset=\"https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-an-https-proxy-with-curl-img-1024x536.jpg 1024w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-an-https-proxy-with-curl-img-300x157.jpg 300w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-an-https-proxy-with-curl-img-768x402.jpg 768w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-an-https-proxy-with-curl-img-600x314.jpg 600w, https:\/\/proxidize.com\/wp-content\/uploads\/2025\/08\/how-to-use-an-https-proxy-with-curl-img.jpg 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use an HTTPS Proxy with cURL<\/h2>\n\n\n\n<p>While HTTP proxies are more common, HTTPS proxies offer an added layer of security by encrypting the traffic between your machine and the proxy server. This is useful when working in environments where privacy and confidentiality are critical such as <a href=\"https:\/\/www.sciencedirect.com\/topics\/computer-science\/corporate-network\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">corporate networks<\/a>, VPN-like setups, or secure data pipelines.<\/p>\n\n\n\t\t<div data-elementor-type=\"container\" data-elementor-id=\"85913\" class=\"elementor elementor-85913\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t<div class=\"elementor-element elementor-element-2bece1e e-con-full no-scale elementor-hidden-mobile_extra elementor-hidden-mobile e-flex e-con e-child\" data-id=\"2bece1e\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;gradient&quot;}\">\n\t\t<div class=\"elementor-element elementor-element-6238a87 e-grid e-con-full e-con e-child\" data-id=\"6238a87\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t<div class=\"elementor-element elementor-element-f8e1416 e-con-full e-flex e-con e-child\" data-id=\"f8e1416\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-25ccff7 elementor-widget elementor-widget-heading\" data-id=\"25ccff7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<p class=\"elementor-heading-title elementor-size-default\">A completely anonymous profile starts<br>\nwith the highest quality mobile proxies<\/p>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-8dff58a e-con-full e-flex e-con e-child\" data-id=\"8dff58a\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t<div class=\"elementor-element elementor-element-ffecf2a e-con-full e-flex e-con e-child\" data-id=\"ffecf2a\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-75ae4a0 elementor-widget__width-initial elementor-widget elementor-widget-image\" data-id=\"75ae4a0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"125\" height=\"80\" src=\"https:\/\/proxidize.com\/wp-content\/uploads\/2025\/10\/20-2.svg\" class=\"attachment-full size-full wp-image-86191\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-40324b9 inline-CTA elementor-widget elementor-widget-button\" data-id=\"40324b9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-button-wrapper\">\n\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/proxidize.com\/mobile-proxy-pricing\/?coupon_code=20OFFMPB\" target=\"_blank\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">Buy Proxies Now<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\n\n\n\n<h3 class=\"wp-block-heading\">cURL HTTPS Proxy without Authentication<\/h3>\n\n\n\n<p><strong>Basic Syntax for HTTPS Proxy<\/strong>:<\/p>\n\n\n\n<p>To use an HTTPS proxy with cURL, you can use the <code>--proxy<\/code> flag and specify the scheme as https:\/\/<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --proxy https:\/\/proxy_host:proxy_port https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/proxy_host:proxy_port<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --proxy https:\/\/myproxy.example.com:443 https:\/\/httpbin.org\/ip<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/myproxy.example.com:443<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/httpbin.org\/ip<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>This commands routes your requests to httpbin.org through an HTTPS proxy<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Using HTTPS Proxy with Authentication<\/h3>\n\n\n\n<p>If your HTTPS proxy requires a username and password, you can include them inline or use <code>--proxy-user<\/code>.<\/p>\n\n\n\n<p><strong>Inline in the URL (basic auth):<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --proxy https:\/\/username:password@proxy_host:port https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/username:password@proxy_host:port<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Or with <code>--proxy-user<\/code>:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --proxy https:\/\/proxy_host:port --proxy-user username:password https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/proxy_host:port<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy-user<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">username:password<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --proxy https:\/\/proxy.mycompany.com:443 --proxy-user admin:secure123 https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/proxy.mycompany.com:443<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy-user<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">admin:secure123<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Avoid hardcoding credentials in scripts; use environments, variables, or prompt users securely.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Handling HTTPS Proxy with Self-Signed Certificates<\/h3>\n\n\n\n<p>If your HTTPS proxy uses a self-signed certificate (common in internal networks), you may run into certificate errors. You can skip SSL verification only if you trust the proxy:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --proxy https:\/\/proxy.example.com:443 --proxy-insecure https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/proxy.example.com:443<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy-insecure<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Alternatively, you can add a custom CA bundle with:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --proxy-cacert my-ca.crt --proxy https:\/\/proxy.example.com:443 https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy-cacert<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">my-ca.crt<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/proxy.example.com:443<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><a href=\"https:\/\/ec.haxx.se\/usingcurl\/verbose\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><strong>Verbose<\/strong><\/a><strong> Output (Optional for Debugging)<\/strong><\/p>\n\n\n\n<p>Want to see how the connection flows through the proxy?<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl -v --proxy https:\/\/proxy.example.com:443 https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">-v<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/proxy.example.com:443<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>This will show you the full TLS handshake, proxy connection status, and headers exchanged.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Summary Table<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Feature<\/th><th>Usage Example<\/th><\/tr><\/thead><tbody><tr><td>HTTPS Proxy (no auth)<\/td><td><code>curl --proxy https:\/\/host:port https:\/\/site.com<\/code><\/td><\/tr><tr><td>HTTPS Proxy (with auth)<\/td><td><code>--proxy-user user:pass<\/code> or inline URL<\/td><\/tr><tr><td>Self-signed cert bypass<\/td><td><code>--proxy-insecure<\/code><\/td><\/tr><tr><td>Provide custom CA for proxy<\/td><td><code>--proxy-cacert file.crt<\/code><\/td><\/tr><tr><td>Debug with verbose<\/td><td><code>-v<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use cURL with Proxy Authentication<\/h2>\n\n\n\n<p>Many <a href=\"https:\/\/proxidize.com\/proxy-server\/\" target=\"_blank\" rel=\"noreferrer noopener\">proxy servers<\/a> require authentication for access, especially in corporate networks or paid proxy services. Fortunately, cURL makes it easy to handle proxy auth.<\/p>\n\n\n\n<p><strong>Basic Proxy Authentication with <code>--proxy-user<\/code><\/strong>:<\/p>\n\n\n\n<p>The most common way is to use the <code>--proxy-user<\/code> option:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --proxy http:\/\/proxy.example.com:8080 --proxy-user username:password https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">http:\/\/proxy.example.com:8080<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy-user<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">username:password<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>This will include a Proxy-Authorization header with your request.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --proxy http:\/\/123.45.67.89:8080 --proxy-user myuser:mypass https:\/\/httpbin.org\/ip<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">http:\/\/123.45.67.89:8080<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy-user<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">myuser:mypass<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/httpbin.org\/ip<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>You\u2019ll get a response from httpbin.org, routed through the proxy with credentials included&nbsp;<\/p>\n\n\n\n<p><strong>Supported Authentication Methods<\/strong>:<\/p>\n\n\n\n<p>By default, cURL tries basic authentication, but if the proxy requires NTLM, Digest, or Negotiate\/Kerberos, cURL supports those too:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use <code>--proxy-ntlm<\/code> for NTLM<\/li>\n\n\n\n<li>Use <code>--proxy-digest<\/code> for Digest auth<\/li>\n\n\n\n<li>Use <code>--proxy-negotiate<\/code> for Kerberos or Negotiate<\/li>\n<\/ul>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#e0def4;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#e0def4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>curl --proxy http:\/\/proxy.company.local:8080 --proxy-user domain\\\\user:pass --proxy-ntlm https:\/\/example.com<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-moon\" style=\"background-color: #232136\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #EA9A97\">curl<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">http:\/\/proxy.company.local:8080<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy-user<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">domain<\/span><span style=\"color: #3E8FB0\">\\\\<\/span><span style=\"color: #F6C177\">user:pass<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #3E8FB0\">--proxy-ntlm<\/span><span style=\"color: #E0DEF4\"> <\/span><span style=\"color: #F6C177\">https:\/\/example.com<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Keep in mind that double backslashes \\\\ are required in Windows domain-style logins.<\/p>\n\n\n\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Now that we\u2019ve covered a variety of ways to use cURL with proxy servers, we hope you can see how useful this setup is in different scenarios. Using proxy with cURL can make a developer\u2019s life much easier, especially when working with APIs, managing large scale requests, or testing behavior across multiple regions.<\/p>\n\n\n\n<p><strong>Key takeaways:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use <code>--proxy<\/code> to specify a proxy server.<\/li>\n\n\n\n<li>Use <code>--proxy-user<\/code> to authenticate with username and password.<\/li>\n\n\n\n<li>Use <code>--proxy-ntlm<\/code>, <code>--proxy-digest<\/code>, or <code>--proxy-negotiate<\/code> for advanced authentication methods.<\/li>\n\n\n\n<li>Use HTTPS proxies for secure communication.<\/li>\n\n\n\n<li>Combine with flags like <code>-x<\/code>, <code>-v<\/code>, or <code>-L<\/code> for full control.<\/li>\n<\/ul>\n\n\n\n<p>Setting the right authentication method is super important, choosing the right proxy protocol, and combining flags like <code>-L<\/code> (follow redirects) or <code>-v<\/code> (verbose output) can make your proxy setup smoother and more powerful.<\/p>\n","protected":false},"author":8854,"featured_media":79289,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","categories":[263],"tags":[],"class_list":["post-79287","blog","type-blog","status-publish","format-standard","has-post-thumbnail","hentry","category-proxies-and-anonymity"],"acf":[],"_links":{"self":[{"href":"https:\/\/proxidize.com\/wp-json\/wp\/v2\/blog\/79287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/proxidize.com\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/proxidize.com\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/proxidize.com\/wp-json\/wp\/v2\/users\/8854"}],"replies":[{"embeddable":true,"href":"https:\/\/proxidize.com\/wp-json\/wp\/v2\/comments?post=79287"}],"version-history":[{"count":10,"href":"https:\/\/proxidize.com\/wp-json\/wp\/v2\/blog\/79287\/revisions"}],"predecessor-version":[{"id":87221,"href":"https:\/\/proxidize.com\/wp-json\/wp\/v2\/blog\/79287\/revisions\/87221"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/proxidize.com\/wp-json\/wp\/v2\/media\/79289"}],"wp:attachment":[{"href":"https:\/\/proxidize.com\/wp-json\/wp\/v2\/media?parent=79287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/proxidize.com\/wp-json\/wp\/v2\/categories?post=79287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/proxidize.com\/wp-json\/wp\/v2\/tags?post=79287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}