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

Behind Corporate proxy #46

Open
Razmuzh opened this issue Sep 30, 2020 · 1 comment
Open

Behind Corporate proxy #46

Razmuzh opened this issue Sep 30, 2020 · 1 comment

Comments

@Razmuzh
Copy link

Razmuzh commented Sep 30, 2020

Had problems connecting to Slack API.
Did the following changes:

Icinga-bot.ini:
Added entry for proxy under [slack]
proxy_url = <PROXY SERVER>:<PORT>

i2_slack_modules/common.py:
Added parser under 'read common section'
config_dict["slack.proxy_url"] = config_handler.get(this_section, "proxy_url", fallback="")

Icinga-bot.py:
Added proxy to connection methods:
client = slack.WebClient(token=config["slack.bot_token"], ssl=slack_ssl_context, proxy=config["slack.proxy_url"], run_async=True)
and
rtm_client = slack.RTMClient( token=config["slack.bot_token"], ssl=slack_ssl_context, run_async=True, loop=loop, proxy="http://" + config["slack.proxy_url"] )

The last will probably fail splendidly if no proxy is defined :) But since the rim_client demanded 'http://' ...

Probably better ways to do this, but it works.

Thanks for making this bot!
R.

@bb-Ricardo
Copy link
Owner

Great idea, will try to add it.

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

No branches or pull requests

2 participants