自定义 Slack Bot 无法连接 [英] Custom Slack Bot cannot connect

查看:53
本文介绍了自定义 Slack Bot 无法连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试制作一个 slack 机器人,它可以回复简单的查询并做一些简单的事情来帮助办公室工作.机器人工作正常,只是它似乎无法从我们的代理后面连接到 Slack.当我通过自己的移动互联网连接测试它时,它工作正常,但是当尝试在代理后面运行它时,它无法连接到 slack.有什么方法可以为机器人配置代理设置以供其在连接时使用?这对我来说很奇怪,因为我们的代理没有以任何方式阻止 Slack.

I've been trying to make a slack bot that replies to simple queries and does some simple stuff to help around the office. The bot works fine, it just seems that it cannot seem to connect to Slack from behind our proxy. When I test it from my own mobile internet connection it works fine, but when trying to run it behind the proxy it cannot connect to slack. Is there any way I can configure proxy settings for the bot to use when it connects? This is all very strange to me because Slack is not blocked in any way by our proxy.

推荐答案

您使用什么语言开发机器人?您用于连接到 API 的库应提供在连接期间使用代理的功能.例如,在 Python 中,您可以使用 requests 包,它允许您定义 HTTP 和 HTTPS 代理.

What language are you developing the bot in? The library you're using to connect to the API should provide functionality to use a proxy during the connection. As an example, in Python you could use the requests package, which allows you to define an HTTP and HTTPS proxy.

(文档)

这篇关于自定义 Slack Bot 无法连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆