automuteus / automuteus

Discord Bot to automute Among Us players at round transitions, in conjunction with https://github.com/automuteus/amonguscapture
https://automute.us
MIT License
946 stars 287 forks source link

reverseproxy subfolder #195

Open GettingTechnicl opened 3 years ago

GettingTechnicl commented 3 years ago

Hello,

I am using Nginx in a docker, I also have the amongusbot hosted in a docker. The amongusbot is fully accessible and reachable via port, although I would like to configure this to work with proxy so I can close the port ofc.

the specific nginx docker that I'm using is "linuxserver/swag"

This docker has many pre-built templates for subdomain and subfolder for various apps that are commonly used, In creating this I decided I would copy the mylar subfolder template.

the docker running the discord bot is named "dbot" and port is set to "8123" The nginx docker and discordbot are both set to run on the same bridge network that I have created.

After editing the template for mylar proxy through subfolder it looks like this.

image

I have also tried ## out the proxy_pass line that's there and creating a new one using the docker ip:port, both of these give me same result, when trying to connect with the Among Us Capture Client I get an error code 200.

Looking for some assistance to get this set up and working, thank you.


Something I just noticed, If I go to connect the captureclient without specifying a port, I get error code 200 no matter what. If I set this even to an incorrect port, I do not get the error code 200, which is leaving me to believe that the among us capture client is not capable of making a connection if a port is not specified. Although I see there are subdomain proxy's that go through. So I'm not sure.

To replicate what I'm seeing open the capture client, open the manual connection window and with any code in the box make the host "https://facebook.com" vs "https://facebook.com:1",

in this scendario just using facebook.com immediately comes back with status code 200, (the error I'm getting) and putting :1 at the end takes a bit to timeout, but ultimately tells me one or more errors occured and that it is unable to connect.


Further testing revealed that what I wrote above does not apply whatsoever.

The domain I am using ends with a .club instead of the usual .com, I tested using my domain although changed .club to .com to see the capture client's reaction, and it did attempt to connect. Although when I put .club back, it immediately gives error code 200.

ShawnHardwick commented 3 years ago

Really don't think this belongs in this project. It's not anything unique to the bot.

GettingTechnicl commented 3 years ago

I would say this is specific to the bot.

For HOST= I can't put in a domain name with a /subfolder as the bot errors and see's a problem with it.

HOST= amongus.TLD.club/automuteus And bot gives error when dm'ing link to connect. This furthers my suspicion that the bot does not know how to connect utilizing a subfolder proxy

I have multiple reverse proxy's working on other machines without issues, I am unable to connect to this bot, because either the way the capture client is set to connect, or because of how the bot is set to receive connections. I am doing nothing more than trying to point out the issues that are preventing me from connecting to this specific bot.

I am quite sure my current proxy setup is correct, as the bot is unable to set a / base url

This would not go in an nginx forum, nginx works fine and can forward subfolders fine

This would not go in to the docker forum, as this docker is doing exactly what it's supposed to be doing and I'm using it with other applications on other servers.

So this should go here because this issue is specific to this application. If you have a better idea of where this "should go" please inform me.

image

denverquane commented 3 years ago

Yeah paths like https://reverse-proxy.com:443/path are not supported. Reverse proxy support right now is limited to redirecting from the base / path on a different port, but not subdomain paths. Happy to accept a PR that introduces this (it would be a reconfiguration of the regex specified here: https://github.com/denverquane/automuteus/blob/master/discord/message_handlers.go#L34), but it's not a priority of mine, personally.

INGY23 commented 3 years ago

Had a quick play and couldn't get it to work unfortunately.

Since this uses web sockets you will also probably need the following if you do find a way to make it work

proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_hide_header X-Frame-Options;