rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: newbie on October 23, 2019, 02:18:01 PM

Title: Get Connections
Post by: newbie on October 23, 2019, 02:18:01 PM
I notice that the UI displays a table for Connections with 6 entries for one client.
Is there a way for me to get that list of IP addresses via a script?

There doesnt appear to be a GetConnections here:
https://www.rejetto.com/wiki/index.php/HFS:_scripting_commands#Connections_control
Title: Re: Get Connections
Post by: bmartino1 on October 23, 2019, 06:44:19 PM
cmd command:

C:\Users\Brandon>netstat -a

example out look:
Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:7              Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:9              Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:13             Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:17             Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:19             Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:135            Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:445            Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:2179           Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:5040           Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:5357           Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:49664          Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:49665          Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:49666          Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:49667          Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:49668          Brandon-Laptop:0       LISTENING
  TCP    0.0.0.0:49672          Brandon-Laptop:0       LISTENING
 
Title: Re: Get Connections
Post by: newbie on October 23, 2019, 08:59:27 PM
Ok. Thanks. That should work.
Title: Re: Get Connections
Post by: newbie on November 11, 2019, 05:55:33 PM
Sorry. I am back. I cannot depend on netstat -a anymore.
The machine is going to be host to numerous other servers, and I want to be able to filter out the non-HFS connections.
I'm thinking of collecting the IPs when the clients make the first initialization call to HFS, and removing the IP when the client disconnects.
Unless you'all know of something better.
Title: Re: Get Connections
Post by: bmartino1 on November 11, 2019, 06:06:07 PM
i remember something with the hfs log and macro ...

something like macro command 
append %ip%

https://www.rejetto.com/wiki/index.php/HFS:_scripting_commands

might have to become an hfs event
like syslog watch dog

https://www.rejetto.com/wiki/index.php/HFS:_Event_scripts

[request]
Append log.txt %time% %ip%

something like that...