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

[BUG] - POrt 80 is opened with forward to port 443 by default with no ability to remove this #474

Open
GRIFFCOMMca opened this issue Jan 8, 2025 · 9 comments
Labels
question Further information is requested

Comments

@GRIFFCOMMca
Copy link

Describe the bug
On starting the application (for Windows) port 80 has a service running which forwards to port 443, no way to delete / turn off or stop it happening.

To Reproduce
Run the application in Windows, open a webpage to http://localhost

Expected behavior
Should not start any servers on any ports other than the admin server port, unless created

Screenshots
2025-01-08 port 80

Host Environment (please complete the following information):

  • Windows 10 Pro
  • Version 3.1.6
@GRIFFCOMMca GRIFFCOMMca added the bug Something isn't working label Jan 8, 2025
@tobychui
Copy link
Owner

tobychui commented Jan 8, 2025

Hi @GRIFFCOMMca

I just reviewed the code and that is the default behavior of Zoraxy. I consider this a feature (less setup steps from user perspective) instead of a bug. If you want that default value to be changed, there are two ways you can achieve that

  1. Modify the default value in code as highlighted below and build from source.
    https://github.com/tobychui/zoraxy/blob/d1e5581eea1b047d07496b672b017c93c774a47d/src/reverseproxy.go#L62C1-L63C54

  2. Visit your admin panel and turn off the redirect. You can find the options under status > global settings (the bottom two toggle as shown in the screenshot below)

圖片

@tobychui tobychui added question Further information is requested and removed bug Something isn't working labels Jan 8, 2025
@GRIFFCOMMca
Copy link
Author

We are using the Windows version, there is no way to edit the code, i feel this should be listed in the panel as you suggested so it can then be removed. Most services this will sit in front of will have port 80 in use and make using this software impossible...

@tobychui
Copy link
Owner

tobychui commented Jan 8, 2025

@GRIFFCOMMca You can temporary shut down the port 80 service and setup Zoraxy, or even change the setting in another machine and copy the whole folder structure over to your homelab gateway server. There are lots of way to do the same desired results you are expecting and I don't see a problem here.

And btw, Golang do have a Windows compiler where you can build the whole code base on Windows and deploy on Windows. Checkout here and README build from source instruction for more details.

@GRIFFCOMMca
Copy link
Author

Hi, going to review this later today, there are some examples though where port 80 on the original install isnt possible, in this case in maybe, i did not see this setting, will respond here in a few hours.

@GRIFFCOMMca
Copy link
Author

GRIFFCOMMca commented Jan 8, 2025

This is interesting, in that area (Status > Global settings) both Enable HTTP server on port 80 AND Force redirect HTTP to HTTPS were both off... i had to enable both then disabled them again for this to work.. so according to my GUI they were off (disabled), however the backend server was doing them even though the GUI said they were not..

@GRIFFCOMMca
Copy link
Author

This is now working, however bug still exists in that the settings you showed are not shown as ACTIVE when installed while they are active in the live server, they both need to flipped off and back on to reflect the real status, then then allows them to be turned off

@tobychui
Copy link
Owner

The UI bug cannot reproduce on my side, but I have optimized this a bit further for beginners.
Now it will check if the port is occupied and print something like this in the terminal.

[2025-01-18 15:17:11.296270] [internal] [system:info] TLS mode disabled. Serving proxy request with plain http
[2025-01-18 15:17:11.296270] [internal] [system:info] Inbound port 80 is occupied. Change the listening port in the webmin panel and press "Start Service" to start reverse proxy service

tobychui added a commit that referenced this issue Jan 18, 2025
- Added automatic port check and reminder for beginners
@fow0ryl
Copy link

fow0ryl commented Jan 23, 2025

This is the first time I'm trying to use zoraxy.
Want to install zoraxy 3.1.6 on my NanoPi R2S (arm64) running OpenWrt. Of course I got the same "port 80 in use" error, because the OpenWrt is running uhttpd at Port 80/443.

I stopped the service as advised with /etc/init.d/uhttpd stop

After that, zoraxy starts as expected. But I got the same effect as @GRIFFCOMMca

This is interesting, in that area (Status > Global settings) both Enable HTTP server on port 80 AND Force redirect HTTP to HTTPS were both off... i had to enable both then disabled them again for this to work

Maybe it could make sense to have a additional option parm to disable redirect when starting zoraxy.

@tobychui
Copy link
Owner

@fow0ryl This has been fixed in the dev branch and will be releasing with 3.1.7. In the dev version, it will automatically disable port redirect if the 80 port is occupied by another process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants