err-backend-cisco-webex-teams
err-backend-cisco-webex-teams copied to clipboard
does not receive messages behind corporate proxy
Unfortunately the backend does not work behind a corporate proxy. The last log message is Tested current Errbot version and it is 5.2.0. Incoming messages are not recognized and logged.
[...]
2019-05-07 16:41:58,535 DEBUG errbot.backends.CiscoWebexTeams Done! I'm connected as {botname}@webex.bot
[...]
2019-05-07 16:41:58,767 DEBUG root Opening websocket connection to wss://mercury-connection-a.wbx2.com/v1/apps/wx2/registrations/{id}/messages
2019-05-07 16:41:58,973 DEBUG urllib3.connectionpool http://{myproxyname}:8080 "GET http://version.errbot.io/?errbot=6.0.0&python=3.7.2 HTTP/1.1" 200 5
2019-05-07 16:41:58,974 DEBUG errbot.plugins.VersionChecker Tested current Errbot version and it is 5.2.0
When I run it without proxy, the websocket connects just fine and the bot receives messages and works as expected.
2019-05-07 16:49:40,362 DEBUG root Opening websocket connection to wss://mercury-connection-a.wbx2.com/v1/apps/wx2/registrations/{id}/messages
2019-05-07 16:49:40,505 DEBUG websockets.protocol client - state = CONNECTING
2019-05-07 16:49:40,529 DEBUG urllib3.connectionpool http://version.errbot.io:80 "GET /?errbot=6.0.0&python=3.7.2 HTTP/1.1" 200 5
2019-05-07 16:49:40,530 DEBUG errbot.plugins.VersionChecker Tested current Errbot version and it is 5.2.0
2019-05-07 16:49:40,765 DEBUG websockets.protocol client - event = connection_made(<asyncio.sslproto._SSLProtocolTransport object at 0x10bfd26a0>)
2019-05-07 16:49:40,893 DEBUG websockets.protocol client - state = OPEN
2019-05-07 16:49:40,894 INFO root WebSocket Opened
Is there a way to pass a proxies parameter to the backend like the Slack backend does? I'd like to run errbot at my company and this is the only thing that keeps me from doing it.
I tested some basic stuff using the webexteamssdk module and it works just fine behind a proxy, so I think the issue is about websockets.
Unfortunately, Python3 Websockets implementation doesn't support proxy yet (The pull request https://github.com/aaugustin/websockets/pull/422 has been sitting there for almost a year).
Looking at the slack client, I see version 2 of their client switched to AIOHTTP specifically for SSL/Proxy support (https://github.com/slackapi/python-slackclient#advanced-options) so I guess I might have to do the same.
Using AIOHTTP seems like a viable solution. I don't think that websockets will support proxies anytime soon.
I found this fork of websockets mdymike/websockets@e3236e0d826e7cfd3a1cc96beec5ce7d76fe5409 support proxy support and got it to work with this webex-teams backend 😄