Webhook: access source ip address

Created on 10 Apr 2019  路  5Comments  路  Source: adnanh/webhook

I was hoping to be able to pass the source IP along to the script, but i couldn't find a way to access it through the request-values section
Am I missing something? Or is my only real option to parse the stdout of webhook and attempt to grab the last line with "incoming HTTP request from" (if that would even work...)

any pointers would be greatly appreciated!

enhancement

Most helpful comment

If we include this in webhook, here's a proposed usage:

{
  "source": "request",
  "name": "remote-addr"
}

Potentially relevant name values from http.Request: method and remote-addr.

All 5 comments

Hey, sorry for the late reply. So far there isn't support in webhook for fetching the source IP but it's on the roadmap and should be included in the next version.

Current workaround is to put nginx in front of webhook and have it pass the source IP via X-Forwarded-For header, which you can then read using the webhook.

Cool. Thanks for the response. It is good to know that it is on the roadmap. Feel free to close this if you like

I'll close it once the feature lands in the development branch :-)

Tagging this with #356 as it should provide a powerful mechanism to craft a solution to this problem.

If we include this in webhook, here's a proposed usage:

{
  "source": "request",
  "name": "remote-addr"
}

Potentially relevant name values from http.Request: method and remote-addr.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

foosinn picture foosinn  路  5Comments

ptflp picture ptflp  路  5Comments

abitrolly picture abitrolly  路  4Comments

avtar picture avtar  路  6Comments

scalp42 picture scalp42  路  4Comments