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 188 forks source link

[BUG] Zoraxy redirects to HTTPS and fails to load #141

Closed Darthagnon closed 6 months ago

Darthagnon commented 7 months ago

Describe the bug I was testing Zoraxy on a Win10 laptop at work, and found that the console kept reporting Failed to get network interface stats: wmic execution timeout, and the management interface on localhost:8000 kept redirecting to an HTTPS version of the page which would always fail to load with The connection for this site is not secure: localhost sent an invalid response. (ERR_SSL_PROTOCOL_ERROR). I managed once or twice to get the HTTP version of the page to load (in Edgium Incognito mode) and it worked fine, but on restarting Zoraxy with admin permissions to try and make the wmic error disappear, I couldn't get the HTTP version to appear.

To Reproduce Steps to reproduce the behavior:

  1. Run Zoraxy on the latest version of Win10 with an admin account, but not "Run as Administrator". I'm using the NT 6.1 build, as that is the version I'll be using on my server.
  2. Open http://localhost:8000 in Edgium (probably other browsers, too)
  3. Page will redirect to https://localhost:8000 and fail to load with The connection for this site is not secure: localhost sent an invalid response. (ERR_SSL_PROTOCOL_ERROR)
  4. Try loading http://localhost:8000 in an Edgium Incognito window and it might load as HTTP and work, rather than HTTPS
  5. Try closing and reopening Zoraxy with "Run as Administrator". Now, step 3 will occur even in Incognito windows.

Expected behavior Zoraxy should default to HTTP, especially on localhost, unless provided with certificates and explicitly told to run as HTTPS?

Screenshots If applicable, add screenshots to help explain your problem.

Browser (if it is a bug appears on the UI section of the system):

Host Environment (please complete the following information):

tobychui commented 7 months ago

It is interesting to see you reported an issue from a feature that Zoraxy doesn't yet support! (TLS support on management interface)

For the warning message Failed to get network interface stats: wmic execution timeout, this is due to your permission settings on Windows. If after retry for a few time and the network stat still cant be resolved, Zoraxy will give up and not showing you the real-time network IO statistic. That will not effect the reverse proxy feature.

For the redirection bug, it is mostly caused by you have something running in the background that also listen to port 8000, or your browser has cached a previous testing session of your other software that written a 301 Moved Permanently header from http://localhost:8000 to https://localhost:8000. Anyway, I am pretty sure this is not a Zoraxy problem but one related to browser / host setup.

tobychui commented 6 months ago

Closing this as this issue is inactive and the redirection is not a bug caused by Zoraxy