Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webhook(): proxy and headers support #524

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MrAnno
Copy link
Member

@MrAnno MrAnno commented Feb 21, 2025

Depends on #523

webhook(port(8080) proxy-header("x-forwarded-for"));
webhook(port(8080) proxy-header(yes));

$ curl -H "x-forwarded-for: 4.3.3.2"
    -H "X-Forwarded-FOR: 1.2.3.4" -X POST --data "{}" http://127.0.0.1:8080

$PEERIP: 127.0.0.1, $SOURCEIP: 1.2.3.4
webhook(port(8080) include-request-headers(yes));

filterx {
    headers = json(${webhook.headers});

    $type = headers["Content-Type"][-1];
    $headers = headers;
};

$headers:

{
  "Host": ["127.0.0.1:8080"],
  "User-Agent": ["curl/8.5.0"],
  "X-Forwarded-For": [
    "4.3.3.2",
    "1.2.3.4"
  ],
  "Content-Length": ["2"],
  "Content-Type": ["application/x-www-form-urlencoded"]
}
$type == "application/x-www-form-urlencoded"

@MrAnno MrAnno force-pushed the webhook-proxy-and-headers branch 2 times, most recently from 5938f9f to 2308174 Compare February 21, 2025 17:45
@MrAnno MrAnno force-pushed the webhook-proxy-and-headers branch from 2308174 to 9295855 Compare February 28, 2025 12:32
MrAnno added a commit to MrAnno/axosyslog that referenced this pull request Feb 28, 2025
Signed-off-by: László Várady <[email protected]>
@MrAnno MrAnno force-pushed the webhook-proxy-and-headers branch from 9295855 to 5b2991d Compare February 28, 2025 12:41
OverOrion
OverOrion previously approved these changes Feb 28, 2025
@MrAnno MrAnno dismissed OverOrion’s stale review February 28, 2025 15:57

The merge-base changed after approval.

@MrAnno MrAnno force-pushed the webhook-proxy-and-headers branch from 5b2991d to 1b2911c Compare February 28, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants