[GH-ISSUE #77] Proxy software tun mode cause addr mismatch #27

Closed
opened 2026-05-05 22:04:56 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @ICE-GB on GitHub (Jan 16, 2024).
Original GitHub issue: https://github.com/feschber/lan-mouse/issues/77

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()
}
Originally created by @ICE-GB on GitHub (Jan 16, 2024). Original GitHub issue: https://github.com/feschber/lan-mouse/issues/77 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 ```rust 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() } ```
Author
Owner

@feschber commented on GitHub (Jan 16, 2024):

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.

<!-- gh-comment-id:1893298676 --> @feschber commented on GitHub (Jan 16, 2024): 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.
Author
Owner

@feschber commented on GitHub (Jan 16, 2024):

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

<!-- gh-comment-id:1894134815 --> @feschber commented on GitHub (Jan 16, 2024): 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
Author
Owner

@ICE-GB commented on GitHub (Jan 17, 2024):

Thanks! I'll give it a try!

<!-- gh-comment-id:1894754842 --> @ICE-GB commented on GitHub (Jan 17, 2024): Thanks! I'll give it a try!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/lan-mouse#27
No description provided.