Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
261 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Long: haproxy-protocol | ||
Help: Send HAProxy PROXY protocol header | ||
Protocols: HTTP | ||
Added: 7.60.0 | ||
--- | ||
Send a HAProxy PROXY protocol header at the beginning of the connection. This | ||
is used by some load balancers and reverse proxies to indicate the client's | ||
true IP address and port. | ||
This option is primarily useful when sending test requests to a service that | ||
expects this header. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
.\" ************************************************************************** | ||
.\" * _ _ ____ _ | ||
.\" * Project ___| | | | _ \| | | ||
.\" * / __| | | | |_) | | | ||
.\" * | (__| |_| | _ <| |___ | ||
.\" * \___|\___/|_| \_\_____| | ||
.\" * | ||
.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. | ||
.\" * | ||
.\" * This software is licensed as described in the file COPYING, which | ||
.\" * you should have received as part of this distribution. The terms | ||
.\" * are also available at https://curl.haxx.se/docs/copyright.html. | ||
.\" * | ||
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell | ||
.\" * copies of the Software, and permit persons to whom the Software is | ||
.\" * furnished to do so, under the terms of the COPYING file. | ||
.\" * | ||
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
.\" * KIND, either express or implied. | ||
.\" * | ||
.\" ************************************************************************** | ||
.\" | ||
.TH CURLOPT_HAPROXYPROTOCOL 3 "5 Feb 2018" "libcurl 7.60.0" "curl_easy_setopt options" | ||
.SH NAME | ||
CURLOPT_HAPROXYPROTOCOL \- send HAProxy PROXY protocol header | ||
.SH SYNOPSIS | ||
#include <curl/curl.h> | ||
|
||
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HAPROXYPROTOCOL, | ||
long haproxy_protocol); | ||
.SH DESCRIPTION | ||
A long parameter set to 1 tells the library to send an HAProxy PROXY | ||
protocol header at beginning of the connection. The default action is not to | ||
send this header. | ||
|
||
This option is primarily useful when sending test requests to a service that | ||
expects this header. | ||
|
||
Most applications do not need this option. | ||
.SH DEFAULT | ||
0, do not send HAProxy PROXY protocol header | ||
.SH PROTOCOLS | ||
HTTP | ||
.SH EXAMPLE | ||
.nf | ||
CURL *curl = curl_easy_init(); | ||
if(curl) { | ||
CURLcode ret; | ||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); | ||
curl_easy_setopt(curl, CURLOPT_HAPROXYPROTOCOL, 1L); | ||
ret = curl_easy_perform(curl); | ||
} | ||
.fi | ||
.SH AVAILABILITY | ||
Along with HTTP. Added in 7.60.0. | ||
.SH RETURN VALUE | ||
Returns CURLE_OK if HTTP is enabled, and CURLE_UNKNOWN_OPTION if not. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<testcase> | ||
<info> | ||
<keywords> | ||
HTTP | ||
HTTP GET | ||
</keywords> | ||
</info> | ||
|
||
# | ||
# Server-side | ||
<reply name="1455"> | ||
<data nocheck=yes> | ||
HTTP/1.1 200 OK | ||
Date: Thu, 09 Nov 2010 14:49:00 GMT | ||
Server: test-server/fake | ||
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT | ||
ETag: "21025-dc7-39462498" | ||
Accept-Ranges: bytes | ||
Content-Length: 6 | ||
Connection: close | ||
Content-Type: text/html | ||
Funny-head: barkbark | ||
|
||
-foo- | ||
</data> | ||
</reply> | ||
|
||
# | ||
# Client-side | ||
<client> | ||
<server> | ||
http | ||
</server> | ||
<name> | ||
HTTP GET when PROXY Protocol enabled | ||
</name> | ||
<command> | ||
http://%HOSTIP:%HTTPPORT/1455 --haproxy-protocol --local-port 37756 | ||
</command> | ||
</client> | ||
|
||
# | ||
# Verify data after the test has been "shot" | ||
<verify> | ||
<strip> | ||
^User-Agent:.* | ||
</strip> | ||
<protocol> | ||
PROXY TCP4 %CLIENTIP %HOSTIP 37756 %HTTPPORT | ||
GET /1455 HTTP/1.1 | ||
Host: %HOSTIP:%HTTPPORT | ||
Accept: */* | ||
|
||
</protocol> | ||
</verify> | ||
</testcase> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<testcase> | ||
<info> | ||
<keywords> | ||
HTTP | ||
HTTP GET | ||
IPv6 | ||
</keywords> | ||
</info> | ||
# | ||
# Server-side | ||
<reply> | ||
<data nocheck=yes> | ||
HTTP/1.1 200 OK | ||
Date: Thu, 09 Nov 2010 14:49:00 GMT | ||
Server: test-server/fake | ||
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT | ||
ETag: "21025-dc7-39462498" | ||
Accept-Ranges: bytes | ||
Content-Length: 6 | ||
Connection: close | ||
Content-Type: text/html | ||
Funny-head: yesyes | ||
|
||
-foo- | ||
</data> | ||
</reply> | ||
|
||
# | ||
# Client-side | ||
<client> | ||
<features> | ||
ipv6 | ||
</features> | ||
<server> | ||
http-ipv6 | ||
</server> | ||
<name> | ||
HTTP-IPv6 GET with PROXY protocol | ||
</name> | ||
<command> | ||
-g "http://%HOST6IP:%HTTP6PORT/1456" --local-port 44444 --haproxy-protocol | ||
</command> | ||
</client> | ||
|
||
# | ||
# Verify data after the test has been "shot" | ||
<verify> | ||
<strip> | ||
^User-Agent: | ||
</strip> | ||
<protocol> | ||
PROXY TCP6 ::1 ::1 44444 %HTTP6PORT | ||
GET /1456 HTTP/1.1 | ||
Host: %HOST6IP:%HTTP6PORT | ||
Accept: */* | ||
|
||
</protocol> | ||
</verify> | ||
</testcase> |