Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow HTTP proxy forwarding to different ports then default HTTP/HTTPS (80/443) #4228

Open
MisterSirCode opened this issue Dec 13, 2024 · 4 comments

Comments

@MisterSirCode
Copy link

Is your feature request related to a problem? Please describe.
I have a game server that requires two different ports from a single subdomain. Dont ask me why, but it runs over HTTP. (5001 and 5003), Theres also an optional port (5002) running on TCP which handles some additional services but isnt required. Not sure if this is something I can solve using the 'streams' feature, but it doesnt let me pick a subdomain so I doubt its what Im looking for.

Describe the solution you'd like
I would love if the proxy manager would allow us to set an external port on each service, instead of just setting HTTP/HTTPS and the forwarded port. IE: I could set domain.site.com:5001 to forward to 10.0.0.1:5001... instead of 10.0.0.1:5001 defaulting to 80/443 and being unconfigurable.

Describe alternatives you've considered
Currently I've found no other service that would work with what I'm trying to do.

Additional context
I cannot change the ports that the server reads (5001, 5002, 5003), and it only accepts a single ip address / URL.

@shalafi99
Copy link

For the http portion of this, to include 2 different ports for the same proxy host FQDN, it seems the suggestion given at #4004 could work (with some minor tweaking, on account of different ports for your use case)

As for the non-http port, it could be streams but streams being related to the transport layer only, indeed no subdomain need to apply (because a subdomain is usually relevant when traffic is being evaluated at the application layer)

@MisterSirCode
Copy link
Author

MisterSirCode commented Dec 14, 2024

For the http portion of this, to include 2 different ports for the same proxy host FQDN, it seems the suggestion given at #4004 could work (with some minor tweaking, on account of different ports for your use case)

As for the non-http port, it could be streams but streams being related to the transport layer only, indeed no subdomain need to apply (because a subdomain is usually relevant when traffic is being evaluated at the application layer)

Do you know of any other tools that can do what I need to do? Im urgently looking for a solution, but Im not even sure what to look for (I dont do networking...)

Itd be nice if NPM could add these features so I could do it natively without using another tool, but unfortunately Im looking to get this running relatively soon.

@shalafi99
Copy link

Do you know of any other tools that can do what I need to do? Im urgently looking for a solution, but Im not even sure what to look for (I dont do networking...)

Itd be nice if NPM could add these features so I could do it natively without using another tool, but unfortunately Im looking to get this running relatively soon.

No, unfortunately I do not know another one.

@spcqike
Copy link

spcqike commented Dec 17, 2024

Currently I've found no other service that would work with what I'm trying to do.

the service you are looking for, is DNS.

idk what your complete setup looks like, but it reads, as if you want a plain DNS entry to point to 10.0.0.1.

for a service, that is reachable from the internet, you most likely allready have an external DNS registered. so point it twards your desired server (or network / router, if its your home connection) and just use simple port forwarding.

example

mydns.com points to my local home router. so my firewall / router routes the traffic based on the port.

mydns.com (without port) gets routed to the nginx server, as "no port" is port 80 for http://mydns.com and port 443 for https://mydns.com

mydns.com:25 gets routed to my mail server
mydns.com:5001 gets routed to my NAS
and so on

if you want to achieve this in a local network only, you need to create an entry in your local DNS server. this should resolve "domain.site.com" to 10.0.0.1 and you are good to go to use any port you like.

if this doesn't work, because you somehow still want to that dns name for some other service, you can always use sub- and sub-sub-domains. like "game.domain.site.com"

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

No branches or pull requests

3 participants