Fetch client local IP

This commit is contained in:
raul 2024-06-10 09:18:48 +02:00
parent 1a0c3ef70b
commit 9029226adc
3 changed files with 5 additions and 2 deletions

View File

@ -174,7 +174,7 @@ func getClient(conn net.Conn) (int, error) {
for i, v := range clientList {
sameClient := basicC.Username == v.ClientBasicInfo.Username &&
basicC.PublicIP == v.ClientBasicInfo.PublicIP &&
basicC.Hostname == v.ClientBasicInfo.Hostname
basicC.Hostname == v.ClientBasicInfo.Hostname && basicC.LocalIP == v.ClientBasicInfo.LocalIP
if sameClient == true {
clientList[i].IsOnline = true

View File

@ -24,6 +24,7 @@ type ClientBasicInfo struct {
OperatingSystem string
Hostname string
PublicIP string
LocalIP string
}
type Instructions struct {

View File

@ -35,7 +35,8 @@
<tr>
<td>ID</td>
<td>Status</td>
<td>IP</td>
<td>Remote IP</td>
<td>Local IP</td>
<td>Username</td>
<td>Hostname</td>
<td>Operating System</td>
@ -60,6 +61,7 @@
{{ end }}
</td>
<td>{{ .ClientBasicInfo.PublicIP }}</td>
<td>{{ .ClientBasicInfo.LocalIP }}</td>
<td>{{ .ClientBasicInfo.Username }}</td>
<td>{{ .ClientBasicInfo.Hostname }}</td>
<td>{{ .ClientBasicInfo.OperatingSystem }}</td>