1
0
mirror of https://github.com/fumiama/go-nd-portal.git synced 2026-06-09 02:26:40 +08:00
Files
go-nd-portal/cmd
chasey-dev f2459dd8d9 refactor: auto get client ip from challenge response (#5)
* refactor: auto get client ip from challenge response
Since `outip()` was not working properly on devices getting local IP addresses behind a router, we should refactor this.
After analyzing the auth process, it is shown that  the challenge response includes key `client_ip` which is the real public IP address with key `ip` not specified in request.
- removed `outip()`
- added rsp key `ClientIP` to get client ip from challenge rsp

* style: trim code

* style: fix spelling issues

* refactor: create `portal_test.go` to handle portal tests separately

* feature: add `ResolveLocalClientIP()` and its test case

* optimize: resolve ClientIP locally when cant be get from challenge response
2025-09-01 22:33:57 +08:00
..