tobychui / zoraxy

A general purpose HTTP reverse proxy and forwarding tool. Now written in Go!
https://zoraxy.aroz.org
GNU Affero General Public License v3.0
3.09k stars 187 forks source link

[QUESTION] Difference between/Purpose of Proxy Root and Inbound Port #98

Closed bepstein111 closed 9 months ago

bepstein111 commented 10 months ago

I'm just confused about the purpose/function of the proxy root and inbound port. If I understand correctly, proxy root is simply a fall-back for anything that doesn't get matched to an existing subdomain or virtual directory? and inbound port is where the proxy is actually listening for inbound traffic (and is separate from the WebUI). Do I have it correct? If that's the case, it seems a little strange to require the proxy root to be set in order to set a listening port when there's a built-in test page already. If nothing's set yet, just show that. It just confused me because it made me think the proxy root's port somehow needed to be related to the inbound port. I could have just been thinking about it too much though. Great app, and great work so far, I'm really liking the functionality!

bepstein111 commented 10 months ago

So, like, should I set my proxy root to 404.mydomain.com (which is where I have a static 404 page hosted)? Or does it need to be the "root" of the domain, mydomain.com? I think I'm confused by the name "proxy root" . I think something like "Fallback URL" or "Fallback Proxy" or even simply "Fallback" makes more sense, to me at least, and only if I was correct in the first comment.

tobychui commented 10 months ago

For your questions:

  1. You are mostly right. But the build-in test page wasn't there when the proxy (root) function was implemented.
  2. Proxy root was called proxy root because this piece of software was a spin-off of my another project that used to only proxy one site (without the other sub-domains). The "root" was added after this project extended its functionality to support other subdomain proxy targets.

I agree with your suggestion. This will need a better name (and code base refactoring) sooner or later. But currently I am working on my thesis and don't got much free time to work on this issue yet. If you know how to program Go / front-end, you are welcomed to contribute some code to get this confusion fixed.

bepstein111 commented 10 months ago

Got it, that makes these things make much more sense. I unfortunately have no experience with Go, but I might be able to take a gander if it's just renaming some things. I am also very busy with work, but I imagine not nearly as busy as you are with your thesis. I wish you the best of luck on that endeavor!

TheVons commented 10 months ago

This is a helpful thread. Can @tobychui elaborate on the port part of this?

tobychui commented 10 months ago

@TheVons I draw a diagram for you real quick.

圖片

TheVons commented 9 months ago

Thanks!

tobychui commented 9 months ago

As the default site was introduced in Zoraxy v3, and there are no follow up questions on this issue, I am closing this issue now.

For future networking noobs: This is for Zoraxy v2. If you have questions regarding how to setup the Inbound port / web ui port in Zoraxy v3, open a new issue.