Skip to content

Behind Corporate proxy #46

Description

@Razmuzh

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions