It would be nice to be able to set a proxy server for the webhooks in the admin panel or in configuration.py
The majority of the companies are behind a corporate proxy and when sending wehbooks requests to slack for example it would be convenient to be able to set a proxy server.
At the moment in my case, I have to manually modify extras/webhooks_worker.py to be able to post notifications to slack.
None
None
I think we can set this by add proxy field in webhook model or add to configuration.py.
configration.py might be flexible, i think.
WEBHOOK_PROXIES = {
'http': 'http://192.168.1.10:3128',
'https': 'http://192.168.2.10:1080',
}
Then set this as proxies attribute to session in webhook_worker.py.
Any idea?
We did the same modification to webhook_worker.py, it works like a charm !
# We need to use proxy to send webhooks
response = session.send(prepared_request, proxies={'https': 'http://proxy.example.org:8080'})
#response = session.send(prepared_request)
But it would be nice to allow also new version checks to pass through a proxy (the same in our case). We didn't find how to do it, yet.
IMO it makes more sense to establish a configuration option to be used for all outbound HTTP connections, rather than defining a proxy individually per webhook.
Most helpful comment
IMO it makes more sense to establish a configuration option to be used for all outbound HTTP connections, rather than defining a proxy individually per webhook.