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

Proxy software tun mode cause addr mismatch #77

Closed
ICE-GB opened this issue Jan 16, 2024 · 3 comments
Closed

Proxy software tun mode cause addr mismatch #77

ICE-GB opened this issue Jan 16, 2024 · 3 comments

Comments

@ICE-GB
Copy link
Contributor

ICE-GB commented Jan 16, 2024

When the request passes through the proxy software using tun mode, the source port will change, causing lan-mouse to ignore the request, is it possible to just determine if the ip is the same?

After I modified it like this it worked for me

c.active && c.client.addrs.iter().any(|&item| match_socket_addr(&item, &addr))
fn match_socket_addr(addr1: &SocketAddr, addr2: &SocketAddr) -> bool {
    addr1.ip() == addr2.ip()
}
@feschber
Copy link
Owner

Yes that would be possible. I have been thinking to do this to allow using it with NAT or similar setups like you described. Probably not the worst idea but debatable if this should be optional or not.

@feschber
Copy link
Owner

I think there is actually no downside to allowing incoming requests from arbitrary ports.

I've gone a bit further than what you proposed and replaced the socket_addrs HashSet with ips completely.
See #78

You can try it out (prebuilt binaries are available @ https://github.com/feschber/lan-mouse/actions/runs/7544659639 if you want).

Will do some more testing to ensure its correct

@ICE-GB
Copy link
Contributor Author

ICE-GB commented Jan 17, 2024

Thanks! I'll give it a try!

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

No branches or pull requests

2 participants