Code Monkey home page Code Monkey logo

Comments (9)

Mereck13579 avatar Mereck13579 commented on June 12, 2024 1

Just to add up on the closure, since I didn't feel confident enough to build outside and push it to container, I just set up a new VM for Zoraxy for testing purposes. I could reproduce the issue with the latest 3.0.3 version, but as I was trying to diagnose it further (with tcpdump) I realized that despite having my local DNS returning the local IP address for the test FQDN the traffic incoming on the VM actually came from OUTSIDE the LAN, so my IPs were effectively not the one I was expecting on the Zoraxy instance... I am currently investingating why that's the case but it means it is outside of Zoraxy's scope.

from zoraxy.

Mereck13579 avatar Mereck13579 commented on June 12, 2024 1

Wrapping it up as I finally found the culprit, since it might be useful to anyone encountering the same issue.
Basically the problem came from Chrome. By default I had "Secure" DNS enabled, effectively bypassing my own local DNS so instead of having test.yangi.re being redirected to 192.168.20.XXX, I had Chrome ask a public DNS about it, returning my public IP instead. This resulted in my request going through the local router, going outside (to my external router) and going back in, effectively coming back with my external router IP instead of mine.

tl;dr, if you use Chrome, go to chrome://settings, search for "DNS" and check if this thing is disabled:
image

Edit: it apparently doesn't care about the "OS Default", my local DNS is supposedly the "OS Default" but that wasn't good enough for Chrome I guess...

from zoraxy.

Mereck13579 avatar Mereck13579 commented on June 12, 2024

Found the following workaround: deactivating the white list seems to make it work

from zoraxy.

tobychui avatar tobychui commented on June 12, 2024

Hi @Mereck13579 , thanks for the issue report. I will try to figure out what is the issue this weekend.

from zoraxy.

Mereck13579 avatar Mereck13579 commented on June 12, 2024

Unsure if it's related or not but it seems like the whitelist rules are not working properly as well at times...

I have a rule to limit some proxies to local addresses only (192.168.20.0/24 in the whitelist, my PC IP is 192.168.20.42) but I get a 403 forbidden when trying to access it. Disabling the white list makes it work.

Tell me if you want me to open another ticket instead for this.

from zoraxy.

tobychui avatar tobychui commented on June 12, 2024

@Mereck13579 Interesting, as I cannot reproduce this in my Zoraxy test environment, can you help me try out something?

Edit src/mod/access/whitelist.go and recompile zoraxy using go mod tidy and go build

//Line 3
import (
	"fmt" //Add this line to import fmt
	"strings"

	"imuslab.com/zoraxy/mod/netutils"
)
func (s *AccessRule) IsIPWhitelisted(ipAddr string) bool {
	//Check for IP wildcard and CIRD rules
	WhitelistedIP := *s.WhiteListIP
	for ipOrCIDR, _ := range WhitelistedIP {
		wildcardMatch := netutils.MatchIpWildcard(ipAddr, ipOrCIDR)
		if wildcardMatch {
			return true
		}

		cidrMatch := netutils.MatchIpCIDR(ipAddr, ipOrCIDR)
		fmt.Println(ipAddr, cidrMatch) //Add this line after line 91
		if cidrMatch {
			return true
		}
	}

	return false
}

Then we will know if your rule is set correctly or there are issue with the CIDR matching logic (which is rare as it is golang's build in function)

from zoraxy.

Mereck13579 avatar Mereck13579 commented on June 12, 2024

I modified the files accordingly in my Zoraxy container image and recreated the image but I'm unsure on where I should execute the go mod tidy and go build commands, is that inside of the container itself afterwards?

from zoraxy.

tobychui avatar tobychui commented on June 12, 2024

@Mereck13579 Oh uh you running Zoraxy in container. In that case, you will need a go compiler inside the container or you build it outside of your container and use SFTP to replace the running binary file in the container.

from zoraxy.

tobychui avatar tobychui commented on June 12, 2024

Fixed in v3.0.3

from zoraxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.