feschber / lan-mouse

mouse & keyboard sharing via LAN
GNU General Public License v3.0
2.62k stars 84 forks source link

If the hostname cannot be resolved, then ips should be used. #197

Closed livexia closed 2 months ago

livexia commented 2 months ago

I think if the hostname cannot be resolved, then ips in config.toml should be used.

If I leave out hostname in config.toml the ui won't show the ips.

[2024-09-11T08:12:55Z DEBUG lan_mouse::server] frontend: GetState(1)            │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse_ipc::connect] requesting: {"UpdateHostname│
~       │":[1,null]}                                                                     │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse_ipc::connect] requesting: {"UpdatePosition│
~       │":[1,"Left"]}                                                                   │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse_ipc::connect] requesting: {"UpdatePort":[1│
~       │,4242]}                                                                         │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse_ipc::connect] requesting: {"ResolveDns":1}│
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse_ipc::connect] requesting: {"GetState":1}  │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse::server] handle frontend request: UpdateHo│
~       │stname(1, None)                                                                 │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse::server] frontend: UpdateHostname(1, None)│
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse::server] handle frontend request: UpdatePo│
~       │sition(1, Left)                                                                 │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse::server] frontend: UpdatePosition(1, Left)│
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse::server] handle frontend request: UpdatePo│
~       │rt(1, 4242)                                                                     │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse::server] frontend: UpdatePort(1, 4242)    │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse::server] handle frontend request: ResolveD│
~       │ns(1)                                                                           │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse::server] frontend: ResolveDns(1)          │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse_ipc::connect] requesting: {"GetState":1}  │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse::server] handle frontend request: GetState│
~       │(1)                                                                             │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse::server] frontend: GetState(1)            │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse::server] handle frontend request: GetState│
~       │(1)                                                                             │
~       │[2024-09-11T08:12:55Z DEBUG lan_mouse::server] frontend: GetState(1)      

config.toml

# optional port (defaults to 4242)
port = 4242
# optional frontend -> defaults to gtk if available
# frontend = "gtk"

# define a client on the right side with host name "iridium"
[right]
hostname = "Pixelbook-Go"
ips = ["192.168.31.127"]
port = 4242

[left]
# hostname = "MacBook-Go-2"
ips = ["192.168.32.176"]
port = 4242
feschber commented 2 months ago

They do get used, they just do not show up in the UI yet. My plan is to have the field that is currently only for the hostname optionally accept ip addresses, when given instead. And then maybe show a list of active ips somewhere in the menu.

livexia commented 2 months ago

Yes, you are right, I test on another machine even the dns unable to resolve, I can still share mouse. I will close now, sorry for the wrong issue.

livexia commented 2 months ago

Yes, you are right, I test on another machine even the dns unable to resolve, I can still share mouse. I will close now, sorry for the wrong issue.

There is another problem when I test with two macos, I found that the shift won't work while using another machine's keyboard.

feschber commented 2 months ago

Yeah macos has some issues. The main problem is the fact that I can only test MacOS on some hacky virtual machines because I dont have a Mac myself.

livexia commented 2 months ago

I have a mac and a problematic hackintosh maybe I can do some test for you but I don't think that will be more helpful.

feschber commented 2 months ago

No worries, it's not very intuitive!