matrix-appservice-discord icon indicating copy to clipboard operation
matrix-appservice-discord copied to clipboard

Add support for http(s) proxy

Open erdnaxeli opened this issue 5 years ago • 2 comments

Hi,

I am trying to deploy the bridge on a restrained environment, where I don't have direct access to Internet. I need the bridge to be able to use an http(s) proxy to talk to discord.

I you have some clues for me I can try to do a PR.

Thanks.

erdnaxeli avatar Oct 12 '20 21:10 erdnaxeli

I'm not sure discord.js supports traditional HTTP proxying. You could however reverse proxy Discord, and have the bridge pass the relevant HTTP options when creating a Discord.Client. Your proxy would have to rewrite the /api/vX/gateway response to contain a websocket URI that points to your proxy, I think.

auscompgeek avatar Oct 14 '20 13:10 auscompgeek

I actually managed to make it works by running it with proxychains. The websocket works perfectly with an HTTPS proxy.

erdnaxeli avatar Nov 11 '20 11:11 erdnaxeli